I have an AlertDialog dlgDetails
which is shown from another AlertDialog dlgMenu
. I would like to be able to show dlgMenu again if the user presses the
This handles both the BACK button and the click OUTSIDE the dialog:
yourBuilder.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
dialog.cancel();
// do your stuff...
}
});
dialog.cancel()
is the key: with dialog.dismiss()
this would handle only the click outside of the dialog, as answered above.