public static interface ActionMode.Callback
View#startActionMode(Callback)
, a Callback
configures and handles events raised by a user's interaction with an action mode.
An action mode's lifecycle is as follows:
onCreateActionMode(ActionMode, Menu)
once on initial
creationonPrepareActionMode(ActionMode, Menu)
after creation
and any time the ActionMode
is invalidatedonActionItemClicked(ActionMode, MenuItem)
any time a
contextual action button is clickedonDestroyActionMode(ActionMode)
when the action mode
is closedModifier and Type | Method and Description |
---|---|
boolean |
onActionItemClicked(ActionMode mode,
MenuItem item)
Called to report a user click on an action button.
|
boolean |
onCreateActionMode(ActionMode mode,
Menu menu)
Called when action mode is first created.
|
void |
onDestroyActionMode(ActionMode mode)
Called when an action mode is about to be exited and destroyed.
|
boolean |
onPrepareActionMode(ActionMode mode,
Menu menu)
Called to refresh an action mode's action menu whenever it is invalidated.
|
boolean onCreateActionMode(ActionMode mode, Menu menu)
mode
- ActionMode being createdmenu
- Menu used to populate action buttonsboolean onPrepareActionMode(ActionMode mode, Menu menu)
mode
- ActionMode being preparedmenu
- Menu used to populate action buttonsboolean onActionItemClicked(ActionMode mode, MenuItem item)
mode
- The current ActionModeitem
- The item that was clickedvoid onDestroyActionMode(ActionMode mode)
mode
- The current ActionMode being destroyedCopyright © 2011–2014. All rights reserved.