public enum

Lifecycle.State

extends java.lang.Enum<Lifecycle.State>

 java.lang.Object

↳java.lang.Enum<Lifecycle.State>

↳androidx.lifecycle.Lifecycle.State

Overview

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

Summary

Enum Constants
CREATEDCreated state for a LifecycleOwner.
DESTROYEDDestroyed state for a LifecycleOwner.
INITIALIZEDInitialized state for a LifecycleOwner.
RESUMEDResumed state for a LifecycleOwner.
STARTEDStarted state for a LifecycleOwner.
Methods
public booleanisAtLeast(Lifecycle.State state)

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

public static Lifecycle.StatevalueOf(java.lang.String name)

public static Lifecycle.Statevalues()

from java.lang.Enum<E>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
from java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait

Enum Constants

DESTROYED

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

INITIALIZED

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

CREATED

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

  • after call;
  • right before call.

STARTED

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

  • after call;
  • right before call.

RESUMED

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

Methods

public static Lifecycle.State values()

public static Lifecycle.State valueOf(java.lang.String name)

public boolean isAtLeast(Lifecycle.State state)

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

Parameters:

state: State to compare with

Returns:

true if this State is greater or equal to the given state