Skip to content

Most visited

Recently visited

navigation
added in version 1.0.0
belongs to Maven artifact android.arch.lifecycle:common:1.0.3

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

added in version 1.0.0
Lifecycle.State CREATED

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

DESTROYED

added in version 1.0.0
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

added in version 1.0.0
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

added in version 1.0.0
Lifecycle.State RESUMED

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

STARTED

added in version 1.0.0
Lifecycle.State STARTED

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

Public methods

isAtLeast

added in version 1.0.0
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

added in version 1.0.0
Lifecycle.State valueOf (String name)

Parameters
name String

Returns
Lifecycle.State

values

added in version 1.0.0
State[] values ()

Returns
State[]

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

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

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 short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)