State

enum State : Enum<State>

Lifecycle states. You can consider the states as the nodes in a graph and LifecycleEvents as the edges between these nodes.

Possible transitions:

[INITIALIZED] ──┐

┌── [CREATED] ──┐
↓ ↑ ↓
[DESTROYED] └── [STARTED] ──┐
↑ ↓
└── [RESUMED]

Entries

Link copied to clipboard

Destroyed state for a LifecycleOwner. After this event, this Lifecycle will not dispatch any more events. For instance, for an android.app.Activity, this state is reached right before Activity's android.app.Activity.onDestroy call.

Link copied to clipboard

Initialized state for a LifecycleOwner. For an android.app.Activity, this is the state when it is constructed but has not received android.app.Activity.onCreate yet.

Link copied to clipboard

Created state for a LifecycleOwner. For an android.app.Activity, this state is reached in two cases:

Link copied to clipboard

Started state for a LifecycleOwner. For an android.app.Activity, this state is reached in two cases:

Link copied to clipboard

Resumed state for a LifecycleOwner. For an android.app.Activity, this state is reached after android.app.Activity.onResume is called.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun isAtLeast(state: State): Boolean

Compares if this State is greater or equal to the given state.

Link copied to clipboard
fun valueOf(value: String): State

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.