I’m trying to have my alert dialog not only close itself when cancelled but also go back to the activity before the one it was called in. Is there a cancel function I can override or is it better to setCancelable(false) and use a KeyListener on the back button?
I’m trying to have my alert dialog not only close itself when cancelled but
Share
When using AlertDialog.Builder to create your AlertDialog you can set a OnCancelListener (OnCancelListener docs).
Then in the listener you can call finish() to destroy the activity.