-1

The problem with the AlertDialog is that when I use dismiss () the AlertDialog does not appear. If I do not use dismiss () the AlertDialog appears, but then how do I disappear it if I have setCancelable in false. I call dismiss in this way:

AlertDialog alertDialog;

alertDialog = new AlertDialog.Builder(this).create();

alertDialog.setTitle("Sinchronize....");

alertDialog.setCancelable(false);

alertDialog.setMessage("Wait");

alertDialog.show();

To eliminate it use

if (alertDialog.isShowing()) { alertDialog.dismiss(); }

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

You can have for example "Cancel" button and execute dismiss() when this button is clicked or if you want to dismiss dialog by itself you can use Handler and execute code after some time.

Dav iD
  • 56
  • 4