Stay organized with collections
Save and categorize content based on your preferences.
OnShowListener
interface OnShowListener
Interface used to allow the creator of a dialog to run some code when the dialog is shown.
Summary
Public methods |
abstract Unit |
This method will be invoked when the dialog is shown.
|
Public methods
onShow
abstract fun onShow(dialog: DialogInterface!): Unit
This method will be invoked when the dialog is shown.
Parameters |
dialog |
DialogInterface!: the dialog that was shown will be passed into the method |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DialogInterface.OnShowListener\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnShowListener\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/content/DialogInterface.OnShowListener \"View this page in Java\") \n\n```\ninterface OnShowListener\n```\n\n|-----------------------------------------------------|\n| [android.content.DialogInterface.OnShowListener](#) |\n\nInterface used to allow the creator of a dialog to run some code when the dialog is shown.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onShow](#onShow(android.content.DialogInterface))`(`dialog:` `[DialogInterface](/reference/kotlin/android/content/DialogInterface)!`)` This method will be invoked when the dialog is shown. |\n\nPublic methods\n--------------\n\n### onShow\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onShow(dialog: DialogInterface!): Unit\n```\n\nThis method will be invoked when the dialog is shown.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------|\n| `dialog` | [DialogInterface](/reference/kotlin/android/content/DialogInterface)!: the dialog that was shown will be passed into the method |"]]