The Android Developer Challenge is back! Submit your idea before December 2.

State

class State
kotlin.Any
   ↳ kotlin.Enum<androidx.lifecycle.Lifecycle.State>
   ↳ androidx.lifecycle.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 state for a LifecycleOwner.

Destroyed state for a LifecycleOwner.

Initialized state for a LifecycleOwner.

Resumed state for a LifecycleOwner.

Started state for a LifecycleOwner.

Public methods

Boolean
isAtLeast(@NonNull state: Lifecycle.State)

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

Enum values

CREATED

enum val CREATED : Lifecycle.State

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

DESTROYED

enum val DESTROYED : Lifecycle.State

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

enum val INITIALIZED : Lifecycle.State

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

enum val RESUMED : Lifecycle.State

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

STARTED

enum val STARTED : Lifecycle.State

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

Public methods

isAtLeast

fun isAtLeast(@NonNull state: Lifecycle.State): Boolean

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

Parameters
state Lifecycle.State: State to compare with
Return
Boolean: true if this State is greater or equal to the given state