Android APIs
public class

Action

extends Object
java.lang.Object
   ↳ android.support.v17.leanback.widget.Action

Class Overview

An action that can be shown on a details page. It contains one or two lines of text and an optional image.

Summary

Public Constructors
Action(long id)
Constructor for an Action.
Action(long id, CharSequence label)
Constructor for an Action.
Action(long id, CharSequence label1, CharSequence label2)
Constructor for an Action.
Action(long id, CharSequence label1, CharSequence label2, Drawable icon)
Constructor for an Action.
Public Methods
final Drawable getIcon()
Returns the icon drawable for this Action.
final long getId()
Returns the id for this Action.
final CharSequence getLabel1()
Returns the first line label for this Action.
final CharSequence getLabel2()
Returns the second line label for this Action.
final void setIcon(Drawable icon)
Set the icon drawable for this Action.
final void setId(long id)
Set id for this Action.
final void setLabel1(CharSequence label)
Set the first line label for this Action.
final void setLabel2(CharSequence label)
Set the second line label for this Action.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Action (long id)

Constructor for an Action.

Parameters
id The id of the Action.

public Action (long id, CharSequence label)

Constructor for an Action.

Parameters
id The id of the Action.
label The label to display for the Action.

public Action (long id, CharSequence label1, CharSequence label2)

Constructor for an Action.

Parameters
id The id of the Action.
label1 The label to display on the first line of the Action.
label2 The label to display on the second line of the Action.

public Action (long id, CharSequence label1, CharSequence label2, Drawable icon)

Constructor for an Action.

Parameters
id The id of the Action.
label1 The label to display on the first line of the Action.
label2 The label to display on the second line of the Action.
icon The icon to display for the Action.

Public Methods

public final Drawable getIcon ()

Returns the icon drawable for this Action.

public final long getId ()

Returns the id for this Action.

public final CharSequence getLabel1 ()

Returns the first line label for this Action.

public final CharSequence getLabel2 ()

Returns the second line label for this Action.

public final void setIcon (Drawable icon)

Set the icon drawable for this Action.

public final void setId (long id)

Set id for this Action.

public final void setLabel1 (CharSequence label)

Set the first line label for this Action.

public final void setLabel2 (CharSequence label)

Set the second line label for this Action.

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.