Serializable, Comparable<Lifecycle.Event>public static enum Lifecycle.Event extends Enum<Lifecycle.Event>
Event when the lifecycle state changes.
The system schedules a lifecycle change and dispatches an Event to Lifecycle.
Lifecycle then dispatches the Event to a registered ILifecycleObserver for responding
to the lifecycle change.
For example, if a registered LifecycleObserver receives an ON_ACTIVE event, it will
call LifecycleObserver#onActive() to change the ability or ability slice to the ACTIVE
state.
SystemCapability.Aafwk#ABILITY| 枚举常量 | 说明 |
|---|---|
ON_ACTIVE |
Event indicating that the ability or ability slice enters the
ACTIVE state. |
ON_BACKGROUND |
Event indicating that the ability or ability slice enters the
BACKGROUND state. |
ON_FOREGROUND |
Event indicating that the lifecycle state of the ability or ability slice is changing from
BACKGROUND to INACTIVE. |
ON_INACTIVE |
Event indicating that the ability or ability slice enters the
INACTIVE state. |
ON_START |
Event indicating the start of the lifecycle.
|
ON_STOP |
Event indicating that the lifecycle is about to be destroyed.
|
UNDEFINED |
Undefined lifecycle event, indicating that the lifecycle may have not started or have been destroyed.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static Lifecycle.Event |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static Lifecycle.Event[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (Lifecycle.Event c : Lifecycle.Event.values()) System.out.println(c); |
public static final Lifecycle.Event UNDEFINED
public static final Lifecycle.Event ON_START
public static final Lifecycle.Event ON_INACTIVE
INACTIVE state.public static final Lifecycle.Event ON_ACTIVE
ACTIVE state.public static final Lifecycle.Event ON_BACKGROUND
BACKGROUND state.public static final Lifecycle.Event ON_FOREGROUND
BACKGROUND to INACTIVE.public static final Lifecycle.Event ON_STOP
public static Lifecycle.Event[] values()
for (Lifecycle.Event c : Lifecycle.Event.values()) System.out.println(c);
public static Lifecycle.Event valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值