Lifecycle.State
public
static
final
enum
Lifecycle.State
extends Enum<Lifecycle.State>
java.lang.Object | ||
↳ | java.lang.Enum<androidx.lifecycle.Lifecycle.State> | |
↳ | androidx.lifecycle.Lifecycle.State |
Lifecycle states. You can consider the states as the nodes in a graph and
Lifecycle.Event
s as the edges between these nodes.
Summary
Enum values | |
---|---|
Lifecycle.State |
CREATED
Created state for a LifecycleOwner. |
Lifecycle.State |
DESTROYED
Destroyed state for a LifecycleOwner. |
Lifecycle.State |
INITIALIZED
Initialized state for a LifecycleOwner. |
Lifecycle.State |
RESUMED
Resumed state for a LifecycleOwner. |
Lifecycle.State |
STARTED
Started state for a LifecycleOwner. |
Public methods | |
---|---|
boolean
|
isAtLeast(Lifecycle.State state)
Compares if this State is greater or equal to the given |
static
Lifecycle.State
|
valueOf(String name)
|
static
final
State[]
|
values()
|
Inherited methods | |
---|---|
Enum values
CREATED
public static final Lifecycle.State CREATED
Created state for a LifecycleOwner. For an Activity
, this state
is reached in two cases:
DESTROYED
public static final Lifecycle.State DESTROYED
Destroyed state for a LifecycleOwner. After this event, this Lifecycle will not dispatch
any more events. For instance, for an Activity
, this state is reached
right before Activity's onDestroy
call.
INITIALIZED
public static final Lifecycle.State INITIALIZED
Initialized state for a LifecycleOwner. For an Activity
, this is
the state when it is constructed but has not received
onCreate
yet.
RESUMED
public static final Lifecycle.State RESUMED
Resumed state for a LifecycleOwner. For an Activity
, this state
is reached after onResume
is called.
STARTED
public static final Lifecycle.State STARTED
Started state for a LifecycleOwner. For an Activity
, this state
is reached in two cases:
Public methods
isAtLeast
public boolean isAtLeast (Lifecycle.State state)
Compares if this State is greater or equal to the given state
.
Parameters | |
---|---|
state |
Lifecycle.State : State to compare with |
Returns | |
---|---|
boolean |
true if this State is greater or equal to the given state
|
valueOf
public static Lifecycle.State valueOf (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
Lifecycle.State |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.