A widget that provides a user interface for the user to enter a search query and submit a request
to a search provider.
When a View implements this interface it will receive callbacks when expanded or
collapsed as an action view alongside the optional, app-specified callbacks to MenuItemCompat.OnActionExpandListener.
See MenuItemCompat for more information about action views.
See ActionBar for more information about the action bar.
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,["# CollapsibleActionView\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1 \nSummary: [Methods](#pubmethods) \\| [\\[Expand All\\]](#) \n\nCollapsibleActionView\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\n\n\ninterface\nCollapsibleActionView\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------|\n| android.support.v7.view.CollapsibleActionView |\n\n|---|---|\n| Known Indirect Subclasses [SearchView](/reference/android/support/v7/widget/SearchView) |---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | [SearchView](/reference/android/support/v7/widget/SearchView) | A widget that provides a user interface for the user to enter a search query and submit a request to a search provider. | ||\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nWhen a [View](https://developer.android.com/reference/android/view/View.html) implements this interface it will receive callbacks when expanded or\ncollapsed as an action view alongside the optional, app-specified callbacks to [MenuItemCompat.OnActionExpandListener](/reference/android/support/v4/view/MenuItemCompat.OnActionExpandListener).\n\nSee [MenuItemCompat](/reference/android/support/v4/view/MenuItemCompat) for more information about action views.\nSee [ActionBar](https://developer.android.com/reference/android/app/ActionBar.html) for more information about the action bar.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onActionViewCollapsed](/reference/android/support/v7/view/CollapsibleActionView#onActionViewCollapsed())`() ` Called when this view is collapsed as an action view. |\n| ` abstract void` | ` `[onActionViewExpanded](/reference/android/support/v7/view/CollapsibleActionView#onActionViewExpanded())`() ` Called when this view is expanded as an action view. |\n\nPublic methods\n--------------\n\n### onActionViewCollapsed\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onActionViewCollapsed ()\n```\n\nCalled when this view is collapsed as an action view. See\n[collapseActionView()](https://developer.android.com/reference/android/view/MenuItem.html#collapseActionView()).\n\n\u003cbr /\u003e\n\n### onActionViewExpanded\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onActionViewExpanded ()\n```\n\nCalled when this view is expanded as an action view. See\n[expandActionView()](https://developer.android.com/reference/android/view/MenuItem.html#expandActionView()).\n\n\u003cbr /\u003e\n\n-\n\n Interfaces\n ----------\n\n - [ActionMode.Callback](/reference/android/support/v7/view/ActionMode.Callback)\n - [CollapsibleActionView](/reference/android/support/v7/view/CollapsibleActionView)\n-\n\n Classes\n -------\n\n - [ActionMode](/reference/android/support/v7/view/ActionMode)\n - [ContextThemeWrapper](/reference/android/support/v7/view/ContextThemeWrapper)"]]