Lifecycle.State

public static final enum Lifecycle.State
extends Enum<Lifecycle.State>

java.lang.Object
   ↳ java.lang.Enum<android.arch.lifecycle.Lifecycle.State>
     ↳ android.arch.lifecycle.Lifecycle.State


Lifecycle states. You can consider the states as the nodes in a graph and Lifecycle.Events 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 state.

static Lifecycle.State valueOf(String name)
static final State[] values()

Inherited methods

Enum values

CREATED

Lifecycle.State CREATED

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

DESTROYED

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

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

Lifecycle.State RESUMED

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

STARTED

Lifecycle.State STARTED

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

Public methods

isAtLeast

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

Lifecycle.State valueOf (String name)

Parameters
name String

Returns
Lifecycle.State

values

State[] values ()

Returns
State[]