public class Action extends Object
Modifier and Type | Field and Description |
---|---|
static long |
NO_ID
Indicates that an id has not been set.
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyCode(int keyCode)
Adds a keycode used to invoke this Action.
|
Drawable |
getIcon()
Returns the icon drawable for this Action.
|
long |
getId()
Returns the id for this Action.
|
CharSequence |
getLabel1()
Returns the first line label for this Action.
|
CharSequence |
getLabel2()
Returns the second line label for this Action.
|
void |
removeKeyCode(int keyCode)
Removes a keycode used to invoke this Action.
|
boolean |
respondsToKeyCode(int keyCode)
Returns true if the Action should respond to the given keycode.
|
void |
setIcon(Drawable icon)
Sets the icon drawable for this Action.
|
void |
setId(long id)
Sets the id for this Action.
|
void |
setLabel1(CharSequence label)
Sets the first line label for this Action.
|
void |
setLabel2(CharSequence label)
Sets the second line label for this Action.
|
String |
toString()
Returns a string representation of the object.
|
public static final long NO_ID
public Action(long id)
id
- The id of the Action.public Action(long id, CharSequence label)
id
- The id of the Action.label
- The label to display for the Action.public Action(long id, CharSequence label1, CharSequence label2)
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)
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 final void setId(long id)
public final long getId()
public final void setLabel1(CharSequence label)
public final CharSequence getLabel1()
public final void setLabel2(CharSequence label)
public final CharSequence getLabel2()
public final void setIcon(Drawable icon)
public final Drawable getIcon()
public final void addKeyCode(int keyCode)
public final void removeKeyCode(int keyCode)
public final boolean respondsToKeyCode(int keyCode)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())