Skip to content

Most visited

Recently visited

navigation

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

From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

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[]

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.