Answers for "how to add dialog box in android"

1

android dialog modal

public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
	setCancelable(false);
}
Posted by: Guest on November-10-2021
0

Android Dialog

AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
builder1.setMessage("Write your message here.");
builder1.setCancelable(true);

builder1.setPositiveButton(
    "Yes",
    new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
        }
    });

builder1.setNegativeButton(
    "No",
    new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
        }
    });

AlertDialog alert11 = builder1.create();
alert11.show();
Posted by: Guest on November-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language