पर क्लिक करता हूं तो एक संवाद खोलता है मेरे पास एक बटन होता है और दबाए जाने पर मैं एक संवाद खोलना चाहता हूं। यह मेरा कोड है:जब मैं एक बटन
Button more = (Button) findViewById(R.id.more);
more.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
//Intent myIntent = new Intent(view.getContext(), agones.class);
//startActivityForResult(myIntent, 0);
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("hi");
alertDialog.setMessage("this is my app");
alertDialog.setButton("Continue..", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// here you can add functions
}
});
}
});
क्या काम नहीं करता है? – RoflcoptrException
इसे अपने कोड अलर्ट में जोड़ें Dialog.show(); – ingsaurabh
कन्स्ट्रक्टर AlertDialog.builder (नया व्यू.ऑनक्लिक लिस्टनर() {}) अपरिभाषित –