How do I close an Android alertdialog

The AlertDialog.Builder itself does not contain a dismiss() or cancel() method.

It is a convenience class to help you create a Dialog, which DOES have access to those methods.

Here is an example:

AlertDialog.Builder builder = new AlertDialog.Builder(this); 

AlertDialog alert = builder.create();

alert.show();

You can then call the alert.cancel() method on the alert (not the builder).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)