Action

public class Action
extends Object

java.lang.Object
   ↳ androidx.leanback.widget.Action


An action contains one or two lines of text, an optional image and an optional id. It may also be invoked by one or more keycodes.

Summary

Constants

long NO_ID

Indicates that an id has not been set.

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 void addKeyCode(int keyCode)

Adds a keycode used to invoke this Action.

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 removeKeyCode(int keyCode)

Removes a keycode used to invoke this Action.

final boolean respondsToKeyCode(int keyCode)

Returns true if the Action should respond to the given keycode.

final void setIcon(Drawable icon)

Sets the icon drawable for this Action.

final void setId(long id)

Sets the id for this Action.

final void setLabel1(CharSequence label)

Sets the first line label for this Action.

final void setLabel2(CharSequence label)

Sets the second line label for this Action.

String toString()

Inherited methods