How to handle AlertDialog close event?

android, android-alertdialog, android-fragments

Solution

an OnDismissListener seems most appropriate, but it requires a relatively high API level, so you might need to stick with an OnCancelListener instead.

Problem

Is there a callback when an AlertDialog is closed using the touch outside event? I have this enabled "setCanceledOnTouchOutside(true)". I want to set a visibility of a specific view once the AlertDialog is closed using the touch outside event. Any ideas? I am using the AlertDialog.Builder() inside a Fragment if that helps.

Original source

Related problems