java.lang.Object | |
↳ | android.view.ActionMode |
Represents a contextual mode of the user interface. Action modes can be used to provide alternative interaction modes and replace parts of the normal UI until finished. Examples of good action modes include text selection and contextual actions.
For information about how to provide contextual actions with
ActionMode
,
read the
Menus
developer guide.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
ActionMode.Callback | Callback interface for action modes. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Finish and close this action mode.
|
||||||||||
|
Returns the current custom view for this action mode.
|
||||||||||
|
Returns the menu of actions that this action mode presents.
|
||||||||||
|
Returns a
MenuInflater
with the ActionMode's context.
|
||||||||||
|
Returns the current subtitle of this action mode.
|
||||||||||
|
Retrieve the tag object associated with this ActionMode.
|
||||||||||
|
Returns the current title of this action mode.
|
||||||||||
|
|
||||||||||
|
Invalidate the action mode and refresh menu content.
|
||||||||||
|
|
||||||||||
|
Set a custom view for this action mode.
|
||||||||||
|
Set the subtitle of the action mode.
|
||||||||||
|
Set the subtitle of the action mode.
|
||||||||||
|
Set a tag object associated with this ActionMode.
|
||||||||||
|
Set the title of the action mode.
|
||||||||||
|
Set the title of the action mode.
|
||||||||||
|
Set whether or not the title/subtitle display for this action mode
is optional.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Finish and close this action mode. The action mode's
ActionMode.Callback
will
have its
onDestroyActionMode(ActionMode)
method called.
Returns the current custom view for this action mode.
Returns the menu of actions that this action mode presents.
Returns a
MenuInflater
with the ActionMode's context.
Returns the current subtitle of this action mode.
Retrieve the tag object associated with this ActionMode.
Like the tag available to views, this allows applications to associate arbitrary data with an ActionMode for later reference.
Returns the current title of this action mode.
Invalidate the action mode and refresh menu content. The mode's
ActionMode.Callback
will have its
onPrepareActionMode(ActionMode, Menu)
method called.
If it returns true the menu will be scanned for updated content and any relevant changes
will be reflected to the user.
Set a custom view for this action mode. The custom view will take the place of the title and subtitle. Useful for things like search boxes.
view | Custom view to use in place of the title/subtitle. |
---|
Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.
resId | Resource ID of a string to set as the subtitle |
---|
Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.
subtitle | Subtitle string to set |
---|
Set a tag object associated with this ActionMode.
Like the tag available to views, this allows applications to associate arbitrary data with an ActionMode for later reference.
tag | Tag to associate with this ActionMode |
---|
Set the title of the action mode. This method will have no visible effect if a custom view has been set.
title | Title string to set |
---|
Set the title of the action mode. This method will have no visible effect if a custom view has been set.
resId | Resource ID of a string to set as the title |
---|
Set whether or not the title/subtitle display for this action mode is optional.
In many cases the supplied title for an action mode is merely meant to add context and is not strictly required for the action mode to be useful. If the title is optional, the system may choose to hide the title entirely rather than truncate it due to a lack of available space.
Note that this is merely a hint; the underlying implementation may choose to ignore this setting under some circumstances.
titleOptional | true if the title only presents optional information. |
---|