Search code examples
androidandroid-dialogfragment

DialogFragment Close Event


I need to handle the end of a DialogFragment (after a call to .dismiss) - for example, I would show a toast inside the activity that "contains" the fragment after dismiss.

How do I handle the event?


Solution

  • Override onDismiss() in your DialogFragment, or use setOnDismissListener() in the code block where you are building the fragment.