Stay organized with collections
Save and categorize content based on your preferences.
interface OnMenuVisibilityListener
Listener for receiving events when action bar menus are shown or hidden.
Summary
Public methods |
abstract Unit |
Called when an action bar menu is shown or hidden.
|
Public methods
abstract fun onMenuVisibilityChanged(isVisible: Boolean): Unit
Called when an action bar menu is shown or hidden. Applications may want to use this to tune auto-hiding behavior for the action bar or pause/resume video playback, gameplay, or other activity within the main content area.
Parameters |
isVisible |
Boolean: True if an action bar menu is now visible, false if no action bar menus are visible. |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ActionBar.OnMenuVisibilityListener\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnMenuVisibilityListener\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/ActionBar.OnMenuVisibilityListener \"View this page in Java\") \n\n```\ninterface OnMenuVisibilityListener\n```\n\n|-----------------------------------------------------|\n| [android.app.ActionBar.OnMenuVisibilityListener](#) |\n\nListener for receiving events when action bar menus are shown or hidden.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onMenuVisibilityChanged](#onMenuVisibilityChanged(kotlin.Boolean))`(`isVisible:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when an action bar menu is shown or hidden. |\n\nPublic methods\n--------------\n\n### onMenuVisibilityChanged\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onMenuVisibilityChanged(isVisible: Boolean): Unit\n```\n\nCalled when an action bar menu is shown or hidden. Applications may want to use this to tune auto-hiding behavior for the action bar or pause/resume video playback, gameplay, or other activity within the main content area.\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `isVisible` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): True if an action bar menu is now visible, false if no action bar menus are visible. |"]]