Answers for "dismiss dialog android studio example"

1

exit dialog android studio

Best Code 

@Override
public void onBackPressed() {
    new AlertDialog.Builder(this)
           .setMessage("Are you sure you want to exit?")
           .setCancelable(false)
           .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int id) {
                   ExampleActivity.super.onBackPressed();
               }
           })
           .setNegativeButton("No", null)
           .show();
}
Posted by: Guest on September-30-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language