Lifecycle.State

enum Lifecycle.State


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

Summary

Enum Values

CREATED

Created state for a LifecycleOwner.

DESTROYED

Destroyed state for a LifecycleOwner.

INITIALIZED

Initialized state for a LifecycleOwner.

RESUMED

Resumed state for a LifecycleOwner.

STARTED

Started state for a LifecycleOwner.

Public constructors

Public methods

boolean

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

static Lifecycle.State
static Lifecycle.State[]

Enum Values

CREATED

Lifecycle.State Lifecycle.State.CREATED

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

DESTROYED

Lifecycle.State Lifecycle.State.DESTROYED

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 onDestroy call.

INITIALIZED

Lifecycle.State Lifecycle.State.INITIALIZED

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

RESUMED

Lifecycle.State Lifecycle.State.RESUMED

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

STARTED

Lifecycle.State Lifecycle.State.STARTED

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

Public constructors

State

public final State()

Public methods

isAtLeast

public boolean isAtLeast(@NonNull Lifecycle.State state)

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

Parameters
@NonNull Lifecycle.State 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)
Throws
java.lang.IllegalArgumentException

values

public static Lifecycle.State[] values()