How to dismiss AlertDialog.Builder?

What didn’t work about dismiss()?

You should be able to use either Dialog.dismiss(), or Dialog.cancel()

alertDialog.setNeutralButton("Cancel", new DialogInterface.OnClickListener() { // define the 'Cancel' button
    public void onClick(DialogInterface dialog, int which) {
        //Either of the following two lines should work.
        dialog.cancel();
        //dialog.dismiss();
    } 
});

Leave a Comment

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