Answers for "dismiss alert dialog in android java"

4

alert dialog on android

new AlertDialog.Builder(this)
    .setTitle("Closing application")
    .setMessage("Are you sure you want to exit?")
    .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {

          }
     }).setNegativeButton("No", null).show();
Posted by: Guest on June-24-2021
-1

alert dialog not displayed android

If : alert.show(); doesn't works try this :

anyViewObject.post(() -> {
  // Create your alert here
  alert.show();
});
Posted by: Guest on October-15-2021

Code answers related to "dismiss alert dialog in android java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language