# DialogInterface.OnDismissListener

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# OnDismissListener

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/content/DialogInterface.OnDismissListener "View this page in Java")  

```
interface OnDismissListener
```

|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [android.content.DialogInterface.OnDismissListener](https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnDismissListener#) |

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [DialogFragment](https://developer.android.com/reference/kotlin/android/app/DialogFragment.html#),[DialogPreference](https://developer.android.com/reference/kotlin/android/preference/DialogPreference.html#),[PreferenceScreen](https://developer.android.com/reference/kotlin/android/preference/PreferenceScreen.html#),[SearchManager](https://developer.android.com/reference/kotlin/android/app/SearchManager.html#) |--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [DialogFragment](https://developer.android.com/reference/kotlin/android/app/DialogFragment.html#)            | A fragment that displays a dialog window, floating on top of its activity's window.                                                                               | | [DialogPreference](https://developer.android.com/reference/kotlin/android/preference/DialogPreference.html#) | A base class for[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference.html#)objects that are dialog-based.                    | | [PreferenceScreen](https://developer.android.com/reference/kotlin/android/preference/PreferenceScreen.html#) | Represents a top-level[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference.html#)that is the root of a Preference hierarchy. | | [SearchManager](https://developer.android.com/reference/kotlin/android/app/SearchManager.html#)              | This class provides access to the system search services.                                                                                                         | |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Indirect Subclasses [EditTextPreference](https://developer.android.com/reference/kotlin/android/preference/EditTextPreference.html#),[ListPreference](https://developer.android.com/reference/kotlin/android/preference/ListPreference.html#),[MultiSelectListPreference](https://developer.android.com/reference/kotlin/android/preference/MultiSelectListPreference.html#) |--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | [EditTextPreference](https://developer.android.com/reference/kotlin/android/preference/EditTextPreference.html#)               | A[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference.html#)that allows for string input.                | | [ListPreference](https://developer.android.com/reference/kotlin/android/preference/ListPreference.html#)                       | A[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference.html#)that displays a list of entries as a dialog. | | [MultiSelectListPreference](https://developer.android.com/reference/kotlin/android/preference/MultiSelectListPreference.html#) | A[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference.html#)that displays a list of entries as a dialog. | |

Interface used to allow the creator of a dialog to run some code when the dialog is dismissed.

## Summary

|                                                                                                                                                                                                       Public methods                                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDismiss](https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnDismissListener#onDismiss(android.content.DialogInterface))`(`dialog:` `[DialogInterface](https://developer.android.com/reference/kotlin/android/content/DialogInterface)!`)` This method will be invoked when the dialog is dismissed. |

## Public methods

### onDismiss

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun onDismiss(dialog: DialogInterface!): Unit
```

This method will be invoked when the dialog is dismissed.

|                                                                                Parameters                                                                                 ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dialog` | [DialogInterface](https://developer.android.com/reference/kotlin/android/content/DialogInterface)!:the dialog that was dismissed will be passed into the method |