# Lifecycle.State

Summary:[Enums](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#enumconstants)\|[Methods](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#inhmethods)  

# Lifecycle.State

| The`android.arch`Architecture Components packages are no longer maintained. They have been superseded by the corresponding[androidx.\*](https://developer.android.com/jetpack/androidx/migrate)packages. See[androidx.lifecycle.Lifecycle.State](https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State)instead.

`
public
static
final

enum
Lifecycle.State
`  
`


``

extends Enum<`[Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State)`>


``


`

|---|---|----------------------------------------|
| java.lang.Object                             |||
| ↳ | java.lang.Enum\<[android.arch.lifecycle.Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State)\> ||
|   | ↳ | android.arch.lifecycle.Lifecycle.State |

<br />

*** ** * ** ***

Lifecycle states. You can consider the states as the nodes in a graph and[Lifecycle.Event](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.Event)s as the edges between these nodes.

## Summary

|                                                                     ### Enum values                                                                      ||
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | `CREATED` Created state for a LifecycleOwner.         |
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | `DESTROYED` Destroyed state for a LifecycleOwner.     |
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | `INITIALIZED` Initialized state for a LifecycleOwner. |
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | `RESUMED` Resumed state for a LifecycleOwner.         |
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | `STARTED` Started state for a LifecycleOwner.         |

|                                                                                                                                                                                                             ### Public methods                                                                                                                                                                                                              ||
|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                                                  | ` `[isAtLeast](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#isAtLeast(android.arch.lifecycle.Lifecycle.State))`(`[Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State)` state) ` Compares if this State is greater or equal to the given`state`. |
| ` static `[Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | ` `[valueOf](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#valueOf(java.lang.String))`(String name) `                                                                                                                                                                                         |
| ` static final `[State[]](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State)   | ` `[values](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State#values())`() `                                                                                                                                                                                                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Enum ` |---------------------------------|-----------------------------------------| | ` final Object`                 | ` clone() `                             | | ` final int`                    | ` compareTo(E arg0) `                   | | ` int`                          | ` compareTo(Object arg0) `              | | ` final boolean`                | ` equals(Object arg0) `                 | | ` final void`                   | ` finalize() `                          | | ` final Class<E>`               | ` getDeclaringClass() `                 | | ` final int`                    | ` hashCode() `                          | | ` final String`                 | ` name() `                              | | ` final int`                    | ` ordinal() `                           | | ` String`                       | ` toString() `                          | | ` static <T extends Enum<T>> T` | ` valueOf(Class<T> arg0, String arg1) ` | ||
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| From interface` java.lang.Comparable ` |-----------------|-----------------------| | ` abstract int` | ` compareTo(E arg0) ` | ||

## Enum values

### CREATED

```
Lifecycle.State CREATED
```

Created state for a LifecycleOwner. For an[Activity](https://developer.android.com/reference/android/app/Activity.html), this state is reached in two cases:

- after[onCreate](https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle))call;
- **right before** [onStop](https://developer.android.com/reference/android/app/Activity.html#onStop())call.

<br />

<br />

### 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](https://developer.android.com/reference/android/app/Activity.html), this state is reached**right before** Activity's[onDestroy](https://developer.android.com/reference/android/app/Activity.html#onDestroy())call.

<br />

### INITIALIZED

```
Lifecycle.State INITIALIZED
```

Initialized state for a LifecycleOwner. For an[Activity](https://developer.android.com/reference/android/app/Activity.html), this is the state when it is constructed but has not received[onCreate](https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle))yet.

<br />

### RESUMED

```
Lifecycle.State RESUMED
```

Resumed state for a LifecycleOwner. For an[Activity](https://developer.android.com/reference/android/app/Activity.html), this state is reached after[onResume](https://developer.android.com/reference/android/app/Activity.html#onResume())is called.

<br />

### STARTED

```
Lifecycle.State STARTED
```

Started state for a LifecycleOwner. For an[Activity](https://developer.android.com/reference/android/app/Activity.html), this state is reached in two cases:

- after[onStart](https://developer.android.com/reference/android/app/Activity.html#onStart())call;
- **right before** [onPause](https://developer.android.com/reference/android/app/Activity.html#onPause())call.

<br />

<br />

## Public methods

### isAtLeast

```
boolean isAtLeast (Lifecycle.State state)
```

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

<br />

|                        Parameters                        ||
|---------|-------------------------------------------------|
| `state` | `Lifecycle.State`: State to compare with <br /> |

|                                   Returns                                    ||
|-----------|-------------------------------------------------------------------|
| `boolean` | true if this State is greater or equal to the given`state` <br /> |

### valueOf

```
Lifecycle.State valueOf (String name)
```

<br />

<br />

|       Parameters        ||
|--------|-----------------|
| `name` | `String` <br /> |

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | <br /> |

### values

```
State[] values ()
```

<br />

<br />

|                                              Returns                                              ||
|-------------------------------------------------------------------------------------------|--------|
| [State[]](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State) | <br /> |

-

  ## Annotations

  - [OnLifecycleEvent](https://developer.android.com/reference/android/arch/lifecycle/OnLifecycleEvent)
-

  ## Interfaces

  - [DefaultLifecycleObserver](https://developer.android.com/reference/android/arch/lifecycle/DefaultLifecycleObserver)
  - [LifecycleObserver](https://developer.android.com/reference/android/arch/lifecycle/LifecycleObserver)
  - [LifecycleOwner](https://developer.android.com/reference/android/arch/lifecycle/LifecycleOwner)
  - [LifecycleRegistryOwner](https://developer.android.com/reference/android/arch/lifecycle/LifecycleRegistryOwner)
  - [Observer](https://developer.android.com/reference/android/arch/lifecycle/Observer)
  - [ViewModelProvider.Factory](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProvider.Factory)
  - [ViewModelStoreOwner](https://developer.android.com/reference/android/arch/lifecycle/ViewModelStoreOwner)
-

  ## Classes

  - [AndroidViewModel](https://developer.android.com/reference/android/arch/lifecycle/AndroidViewModel)
  - [Lifecycle](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle)
  - [LifecycleRegistry](https://developer.android.com/reference/android/arch/lifecycle/LifecycleRegistry)
  - [LifecycleService](https://developer.android.com/reference/android/arch/lifecycle/LifecycleService)
  - [LiveData](https://developer.android.com/reference/android/arch/lifecycle/LiveData)
  - [LiveDataReactiveStreams](https://developer.android.com/reference/android/arch/lifecycle/LiveDataReactiveStreams)
  - [MediatorLiveData](https://developer.android.com/reference/android/arch/lifecycle/MediatorLiveData)
  - [MutableLiveData](https://developer.android.com/reference/android/arch/lifecycle/MutableLiveData)
  - [ProcessLifecycleOwner](https://developer.android.com/reference/android/arch/lifecycle/ProcessLifecycleOwner)
  - [ServiceLifecycleDispatcher](https://developer.android.com/reference/android/arch/lifecycle/ServiceLifecycleDispatcher)
  - [Transformations](https://developer.android.com/reference/android/arch/lifecycle/Transformations)
  - [ViewModel](https://developer.android.com/reference/android/arch/lifecycle/ViewModel)
  - [ViewModelProvider](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProvider)
  - [ViewModelProvider.AndroidViewModelFactory](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProvider.AndroidViewModelFactory)
  - [ViewModelProvider.NewInstanceFactory](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProvider.NewInstanceFactory)
  - [ViewModelProviders](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProviders)
  - [ViewModelProviders.DefaultFactory](https://developer.android.com/reference/android/arch/lifecycle/ViewModelProviders.DefaultFactory)
  - [ViewModelStore](https://developer.android.com/reference/android/arch/lifecycle/ViewModelStore)
  - [ViewModelStores](https://developer.android.com/reference/android/arch/lifecycle/ViewModelStores)
-

  ## Enums

  - [Lifecycle.Event](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.Event)
  - [Lifecycle.State](https://developer.android.com/reference/android/arch/lifecycle/Lifecycle.State)