public static class Timer.TimerIntent extends Object
Intent data class to send after a timer is triggered.
This class is used when you set a timer. After the timer is triggered, the system starts a component in a
ability type, and this class is used to specify parameters for the
RepeatTimer#getTimer(Context context, TimerIntent operation) or
OneShotTimer#getTimer(Context context, TimerIntent operation) method. The constructor of this class
accepts two parameters Intent and ability type, respectively representing the intent and its type
sent by the system when the timer is triggered. The intent cannot be null, and the intent type must be valid.
Otherwise, the getTimer return value will be null, and the timer setting will fail.
| 构造器 | 说明 |
|---|---|
TimerIntent(Intent intent,
int abilityType) |
A constructor used to create a
TimerIntent instance. |
public TimerIntent(Intent intent, int abilityType)
TimerIntent instance.intent - Indicates the intent to send after the timer is triggered.abilityType - Indicates the ability component type.public Intent getIntent()
public int getAbilityType()
public boolean isValid()
TimerIntent object is valid.true if this object is valid; returns false otherwise.