# DialogInterface.OnShowListener

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

# OnShowListener

*** ** * ** ***

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

```
interface OnShowListener
```

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

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

## Summary

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

## Public methods

### onShow

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

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

This method will be invoked when the dialog is shown.

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