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 [version 24.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1 \n\nActionBar.OnMenuVisibilityListener\n==================================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\nstatic\n\n\ninterface\nActionBar.OnMenuVisibilityListener\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------------|\n| android.support.v7.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/support/v7/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 [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid 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 |\n\n-\n\n Interfaces\n ----------\n\n - [ActionBar.OnMenuVisibilityListener](/reference/android/support/v7/app/ActionBar.OnMenuVisibilityListener)\n - [ActionBar.OnNavigationListener](/reference/android/support/v7/app/ActionBar.OnNavigationListener)\n - [ActionBar.TabListener](/reference/android/support/v7/app/ActionBar.TabListener)\n - [ActionBarDrawerToggle.Delegate](/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate)\n - [ActionBarDrawerToggle.DelegateProvider](/reference/android/support/v7/app/ActionBarDrawerToggle.DelegateProvider)\n - [AppCompatCallback](/reference/android/support/v7/app/AppCompatCallback)\n-\n\n Classes\n -------\n\n - [ActionBar](/reference/android/support/v7/app/ActionBar)\n - [ActionBar.LayoutParams](/reference/android/support/v7/app/ActionBar.LayoutParams)\n - [ActionBar.Tab](/reference/android/support/v7/app/ActionBar.Tab)\n - [ActionBarDrawerToggle](/reference/android/support/v7/app/ActionBarDrawerToggle)\n - [AlertDialog](/reference/android/support/v7/app/AlertDialog)\n - [AlertDialog.Builder](/reference/android/support/v7/app/AlertDialog.Builder)\n - [AppCompatActivity](/reference/android/support/v7/app/AppCompatActivity)\n - [AppCompatDelegate](/reference/android/support/v7/app/AppCompatDelegate)\n - [AppCompatDialog](/reference/android/support/v7/app/AppCompatDialog)\n - [AppCompatDialogFragment](/reference/android/support/v7/app/AppCompatDialogFragment)\n - [AppCompatViewInflater](/reference/android/support/v7/app/AppCompatViewInflater)\n - [MediaRouteActionProvider](/reference/android/support/v7/app/MediaRouteActionProvider)\n - [MediaRouteButton](/reference/android/support/v7/app/MediaRouteButton)\n - [MediaRouteChooserDialog](/reference/android/support/v7/app/MediaRouteChooserDialog)\n - [MediaRouteChooserDialogFragment](/reference/android/support/v7/app/MediaRouteChooserDialogFragment)\n - [MediaRouteControllerDialog](/reference/android/support/v7/app/MediaRouteControllerDialog)\n - [MediaRouteControllerDialogFragment](/reference/android/support/v7/app/MediaRouteControllerDialogFragment)\n - [MediaRouteDialogFactory](/reference/android/support/v7/app/MediaRouteDialogFactory)\n - [MediaRouteDiscoveryFragment](/reference/android/support/v7/app/MediaRouteDiscoveryFragment)"]]