Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
ActionBar.OnMenuVisibilityListener
android.app.ActionBar.OnMenuVisibilityListener
|
Listener for receiving events when action bar menus are shown or hidden.
Summary
Public methods |
abstract
void
|
onMenuVisibilityChanged(boolean isVisible)
Called when an action bar menu is shown or hidden.
|
Public methods
public abstract void onMenuVisibilityChanged (boolean isVisible)
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ActionBar.OnMenuVisibilityListener\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nActionBar.OnMenuVisibilityListener\n==================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/app/ActionBar.OnMenuVisibilityListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nActionBar.OnMenuVisibilityListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------|\n| android.app.ActionBar.OnMenuVisibilityListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListener for receiving events when action bar menus are shown or hidden.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onMenuVisibilityChanged](/reference/android/app/ActionBar.OnMenuVisibilityListener#onMenuVisibilityChanged(boolean))`(boolean isVisible) ` Called when an action bar menu is shown or hidden. |\n\nPublic methods\n--------------\n\n### onMenuVisibilityChanged\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onMenuVisibilityChanged (boolean isVisible)\n```\n\nCalled when an action bar menu is shown or hidden. Applications may want to use\nthis to tune auto-hiding behavior for the action bar or pause/resume video playback,\ngameplay, or other activity within the main content area.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------------------------|\n| `isVisible` | `boolean`: True if an action bar menu is now visible, false if no action bar menus are visible. \u003cbr /\u003e |"]]