# androidx.lifecycle

*** ** * ** ***

## Annotations

|---|---|
| `https://developer.android.com/reference/androidx/lifecycle/OnLifecycleEvent` | **This annotation is deprecated.** This annotation required the usage of code generation or reflection, which should be avoided. <br /> |

## Interfaces

|---|---|
| `https://developer.android.com/reference/androidx/lifecycle/DefaultLifecycleObserver` | Callback interface for listening to `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` state changes. |
| `https://developer.android.com/reference/androidx/lifecycle/HasDefaultViewModelProviderFactory` | An interface marking a `https://developer.android.com/reference/androidx/lifecycle/ViewModelStoreOwner` as having a default `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` for use with `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider`. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleEventObserver` | Interface for receiving any `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event` state changes. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver` | Marker interface that indicates a class is a `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver`. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` | A class that exposes a `https://developer.android.com/reference/androidx/lifecycle/Lifecycle`. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleRegistryOwner` | **This interface is deprecated.** Use `androidx.appcompat.app.AppCompatActivity` which extends `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner`, so there are no use cases for this class. <br /> |
| `https://developer.android.com/reference/androidx/lifecycle/LiveDataScope` | Interface that allows controlling a `https://developer.android.com/reference/androidx/lifecycle/LiveData` from a coroutine block. |
| `https://developer.android.com/reference/androidx/lifecycle/Observer` | A simple callback that can receive from `https://developer.android.com/reference/androidx/lifecycle/LiveData`. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` | Implementations of the `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` interface are responsible for instantiating `https://developer.android.com/reference/androidx/lifecycle/ViewModel`s. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelStoreOwner` | A scope that owns a `https://developer.android.com/reference/androidx/lifecycle/ViewModelStore`. |

## Classes

|---|---|
| `https://developer.android.com/reference/androidx/lifecycle/AbstractSavedStateViewModelFactory` | **This class is deprecated.** Use \`viewModelFactory\` or implement \`ViewModelProvider.Factory\`, combined with \`CreationExtras.createSavedStateHandle()\`. |
| `https://developer.android.com/reference/androidx/lifecycle/AndroidViewModel` | `https://developer.android.com/reference/androidx/lifecycle/ViewModel` that has access to the `https://developer.android.com/reference/android/app/Application.html` context. |
| `https://developer.android.com/reference/androidx/lifecycle/AndroidViewModelKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/CoroutineLiveDataKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/FlowExtKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/FlowLiveDataConversions` |   |
| `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` | Defines an object with a lifecycle state control flow. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleCoroutineScope` | `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html` tied to a `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` and `Dispatchers.Main.immediate`. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwnerFactory` |   |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwnerKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleRegistry` | A `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` implementation that manages multiple `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver`s. |
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleService` | A Service that is also a `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner`. |
| `https://developer.android.com/reference/androidx/lifecycle/LiveData` | LiveData is a data holder class that can be observed within a given lifecycle. |
| `https://developer.android.com/reference/androidx/lifecycle/LiveDataKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/LiveDataReactiveStreams` |   |
| `https://developer.android.com/reference/androidx/lifecycle/MediatorLiveData` | `https://developer.android.com/reference/androidx/lifecycle/LiveData` subclass which may observe other `LiveData` objects and react on `OnChanged` events from them. |
| `https://developer.android.com/reference/androidx/lifecycle/MutableLiveData` | `https://developer.android.com/reference/androidx/lifecycle/LiveData` which publicly exposes `https://developer.android.com/reference/androidx/lifecycle/MutableLiveData#setValue(T)` and `https://developer.android.com/reference/androidx/lifecycle/MutableLiveData#postValue(T)` method. |
| `https://developer.android.com/reference/androidx/lifecycle/PausingDispatcherKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ProcessLifecycleInitializer` | Initializes `https://developer.android.com/reference/androidx/lifecycle/ProcessLifecycleOwner` using `androidx.startup`. |
| `https://developer.android.com/reference/androidx/lifecycle/ProcessLifecycleOwner` | Class that provides lifecycle for the whole application process. |
| `https://developer.android.com/reference/androidx/lifecycle/RepeatOnLifecycleKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/SavedStateHandle` | A handle to saved state passed to `https://developer.android.com/reference/androidx/lifecycle/ViewModel`. |
| `https://developer.android.com/reference/androidx/lifecycle/SavedStateHandleSupport` |   |
| `https://developer.android.com/reference/androidx/lifecycle/SavedStateViewModelFactory` | A `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` that creates `https://developer.android.com/reference/androidx/lifecycle/ViewModel`s with access to a `https://developer.android.com/reference/androidx/lifecycle/SavedStateHandle` in their constructor. |
| `https://developer.android.com/reference/androidx/lifecycle/ServiceLifecycleDispatcher` | Helper class to dispatch lifecycle events for a Service. |
| `https://developer.android.com/reference/androidx/lifecycle/Transformations` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModel` | Prepares and manages data for the UI. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelLazy` | An implementation of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-lazy/index.html` to facilitate lazy retrieval of `https://developer.android.com/reference/androidx/lifecycle/ViewModel` instances. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider` | A utility class that manages the lifecycle, caching, and instantiation of `https://developer.android.com/reference/androidx/lifecycle/ViewModel` instances. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.AndroidViewModelFactory` | Factory that creates `https://developer.android.com/reference/androidx/lifecycle/AndroidViewModel` and `https://developer.android.com/reference/androidx/lifecycle/ViewModel` instances. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.NewInstanceFactory` | Factory that creates `https://developer.android.com/reference/androidx/lifecycle/ViewModel` instances by calling their no-argument constructor. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.NewInstanceFactory` | Simple factory, which calls empty constructor on the give class. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProviderGetKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProviders` | **This class is deprecated.** Use the constructors for `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider` directly. <br /> |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProviders.DefaultFactory` | **This class is deprecated.** Use ViewModelProvider.AndroidViewModelFactory <br /> |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelStore` | Stores `https://developer.android.com/reference/androidx/lifecycle/ViewModel` instances by key. |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelStoreOwnerDefaults` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelStores` | **This class is deprecated.** Use `https://developer.android.com/reference/androidx/activity/ComponentActivity#getViewModelStore()` or `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewModelStore()` to retrieve a `ViewModelStore` directly from activities and fragments. <br /> |
| `https://developer.android.com/reference/androidx/lifecycle/ViewTreeLifecycleOwner` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewTreeViewModelStoreOwner` |   |
| `https://developer.android.com/reference/androidx/lifecycle/WithLifecycleStateKt` |   |
| `https://developer.android.com/reference/androidx/lifecycle/SavedStateHandle.Companion` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Companion` |   |
| `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.NewInstanceFactory.Companion` |   |

## Enums

|---|---|
| `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event` | Represents a transition event triggered by a change in the `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner`'s state. |
| `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State` | Represents the current lifecycle state of a `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner`. |

## Exceptions

|---|---|
| `https://developer.android.com/reference/androidx/lifecycle/LifecycleDestroyedException` | A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html` that indicates that the `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` associated with an operation reached the `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State#DESTROYED` state before the operation could complete. |