public abstract class

ActionMode

extends Object
java.lang.Object
   ↳ android.view.ActionMode

Class Overview

Represents a contextual mode of the user interface. Action modes can be used for modal interactions with content and replace parts of the normal UI until finished. Examples of good action modes include selection modes, search, content editing, etc.

Summary

Nested Classes
interface ActionMode.Callback Callback interface for action modes. 
Public Constructors
ActionMode()
Public Methods
abstract void finish()
Finish and close this action mode.
abstract View getCustomView()
Returns the current custom view for this action mode.
abstract Menu getMenu()
Returns the menu of actions that this action mode presents.
abstract MenuInflater getMenuInflater()
Returns a MenuInflater with the ActionMode's context.
abstract CharSequence getSubtitle()
Returns the current subtitle of this action mode.
Object getTag()
Retrieve the tag object associated with this ActionMode.
abstract CharSequence getTitle()
Returns the current title of this action mode.
abstract void invalidate()
Invalidate the action mode and refresh menu content.
abstract void setCustomView(View view)
Set a custom view for this action mode.
abstract void setSubtitle(int resId)
Set the subtitle of the action mode.
abstract void setSubtitle(CharSequence subtitle)
Set the subtitle of the action mode.
void setTag(Object tag)
Set a tag object associated with this ActionMode.
abstract void setTitle(CharSequence title)
Set the title of the action mode.
abstract void setTitle(int resId)
Set the title of the action mode.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ActionMode ()

Since: API Level 11

Public Methods

public abstract void finish ()

Since: API Level 11

Finish and close this action mode. The action mode's ActionMode.Callback will have its onDestroyActionMode(ActionMode) method called.

public abstract View getCustomView ()

Since: API Level 11

Returns the current custom view for this action mode.

Returns
  • The current custom view

public abstract Menu getMenu ()

Since: API Level 11

Returns the menu of actions that this action mode presents.

Returns
  • The action mode's menu.

public abstract MenuInflater getMenuInflater ()

Since: API Level 11

Returns a MenuInflater with the ActionMode's context.

public abstract CharSequence getSubtitle ()

Since: API Level 11

Returns the current subtitle of this action mode.

Returns
  • Subtitle text

public Object getTag ()

Since: API Level 14

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
  • Tag associated with this ActionMode
See Also

public abstract CharSequence getTitle ()

Since: API Level 11

Returns the current title of this action mode.

Returns
  • Title text

public abstract void invalidate ()

Since: API Level 11

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.

public abstract void setCustomView (View view)

Since: API Level 11

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.

Parameters
view Custom view to use in place of the title/subtitle.

public abstract void setSubtitle (int resId)

Since: API Level 11

Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Parameters
resId Resource ID of a string to set as the subtitle

public abstract void setSubtitle (CharSequence subtitle)

Since: API Level 11

Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Parameters
subtitle Subtitle string to set

public void setTag (Object tag)

Since: API Level 14

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.

Parameters
tag Tag to associate with this ActionMode
See Also

public abstract void setTitle (CharSequence title)

Since: API Level 11

Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Parameters
title Title string to set

public abstract void setTitle (int resId)

Since: API Level 11

Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Parameters
resId Resource ID of a string to set as the title