Called when a support action mode is being started for this window. Gives the
callback an opportunity to handle the action mode in its own unique and
beautiful way. If this method returns null the system can choose a way
to present the mode or choose not to start the mode at all.
Parameters
callback
ActionMode.Callback: Callback to control the lifecycle of this action mode
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,["# AppCompatCallback\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 \nSummary: [Methods](#pubmethods) \\| [\\[Expand All\\]](#) \n\nAppCompatCallback\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\nAppCompatCallback\n`\n\n\n`\n\n\n`\n\n|------------------------------------------|\n| android.support.v7.app.AppCompatCallback |\n\n|---|---|\n| Known Indirect Subclasses [AlertDialog](/reference/android/support/v7/app/AlertDialog),[AppCompatActivity](/reference/android/support/v7/app/AppCompatActivity),[AppCompatDialog](/reference/android/support/v7/app/AppCompatDialog),[MediaRouteChooserDialog](/reference/android/support/v7/app/MediaRouteChooserDialog),[MediaRouteControllerDialog](/reference/android/support/v7/app/MediaRouteControllerDialog) |--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | [AlertDialog](/reference/android/support/v7/app/AlertDialog) | A subclass of Dialog that can display one, two or three buttons. | | [AppCompatActivity](/reference/android/support/v7/app/AppCompatActivity) | Base class for activities that use the [support library](/tools/extras/support-library) action bar features. | | [AppCompatDialog](/reference/android/support/v7/app/AppCompatDialog) | Base class for AppCompat themed [Dialog](https://developer.android.com/reference/android/app/Dialog.html)s. | | [MediaRouteChooserDialog](/reference/android/support/v7/app/MediaRouteChooserDialog) | This class implements the route chooser dialog for [MediaRouter](/reference/android/support/v7/media/MediaRouter). | | [MediaRouteControllerDialog](/reference/android/support/v7/app/MediaRouteControllerDialog) | This class implements the route controller dialog for [MediaRouter](/reference/android/support/v7/media/MediaRouter). | ||\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nImplemented this in order for AppCompat to be able to callback in certain situations.\n\n\nThis should be provided to\n[create(android.app.Activity, AppCompatCallback)](/reference/android/support/v7/app/AppCompatDelegate#create(android.app.Activity, android.support.v7.app.AppCompatCallback)).\n\nSummary\n-------\n\n| ### Public methods ||\n|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onSupportActionModeFinished](/reference/android/support/v7/app/AppCompatCallback#onSupportActionModeFinished(android.support.v7.view.ActionMode))`(`[ActionMode](/reference/android/support/v7/view/ActionMode)` mode) ` Called when a support action mode has finished. |\n| ` abstract void` | ` `[onSupportActionModeStarted](/reference/android/support/v7/app/AppCompatCallback#onSupportActionModeStarted(android.support.v7.view.ActionMode))`(`[ActionMode](/reference/android/support/v7/view/ActionMode)` mode) ` Called when a support action mode has been started. |\n| ` abstract `[ActionMode](/reference/android/support/v7/view/ActionMode) | ` `[onWindowStartingSupportActionMode](/reference/android/support/v7/app/AppCompatCallback#onWindowStartingSupportActionMode(android.support.v7.view.ActionMode.Callback))`(`[ActionMode.Callback](/reference/android/support/v7/view/ActionMode.Callback)` callback) ` Called when a support action mode is being started for this window. |\n\nPublic methods\n--------------\n\n### onSupportActionModeFinished\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onSupportActionModeFinished (ActionMode mode)\n```\n\nCalled when a support action mode has finished.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|----------------------------------------------------------|\n| `mode` | `ActionMode`: The action mode that just finished. \u003cbr /\u003e |\n\n### onSupportActionModeStarted\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onSupportActionModeStarted (ActionMode mode)\n```\n\nCalled when a support action mode has been started.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|-------------------------------------------|\n| `mode` | `ActionMode`: The new action mode. \u003cbr /\u003e |\n\n### onWindowStartingSupportActionMode\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nActionMode onWindowStartingSupportActionMode (ActionMode.Callback callback)\n```\n\nCalled when a support action mode is being started for this window. Gives the\ncallback an opportunity to handle the action mode in its own unique and\nbeautiful way. If this method returns null the system can choose a way\nto present the mode or choose not to start the mode at all.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-------------------------------------------------------------------------------------|\n| `callback` | `ActionMode.Callback`: Callback to control the lifecycle of this action mode \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [ActionMode](/reference/android/support/v7/view/ActionMode) | The ActionMode that was started, or null if the system should present it \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)"]]