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 |
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 |
Annotations
Interfaces
Classes
- AndroidViewModel
- Lifecycle
- LifecycleRegistry
- LifecycleService
- LiveData
- LiveDataReactiveStreams
- MediatorLiveData
- MutableLiveData
- ProcessLifecycleOwner
- ServiceLifecycleDispatcher
- Transformations
- ViewModel
- ViewModelProvider
- ViewModelProvider.AndroidViewModelFactory
- ViewModelProvider.NewInstanceFactory
- ViewModelProviders
- ViewModelProviders.DefaultFactory
- ViewModelStore
- ViewModelStores
Enums
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.