androidx.lifecycle


Annotations

OnLifecycleEvent

This annotation is deprecated.

This annotation required the usage of code generation or reflection, which should be avoided.

Interfaces

DefaultLifecycleObserver

Callback interface for listening to LifecycleOwner state changes.

HasDefaultViewModelProviderFactory

An interface marking a ViewModelStoreOwner as having a default ViewModelProvider.Factory for use with ViewModelProvider.

LifecycleEventObserver

Interface for receiving any Lifecycle.Event state changes.

LifecycleObserver

Marker interface that indicates a class is a LifecycleObserver.

LifecycleOwner

A class that exposes a Lifecycle.

LifecycleRegistryOwner

This interface is deprecated.

Use androidx.appcompat.app.AppCompatActivity which extends LifecycleOwner, so there are no use cases for this class.

LiveDataScope

Interface that allows controlling a LiveData from a coroutine block.

Observer

A simple callback that can receive from LiveData.

ViewModelProvider.Factory

Implementations of the Factory interface are responsible for instantiating ViewModels.

ViewModelStoreOwner

A scope that owns a ViewModelStore.

Classes

AbstractSavedStateViewModelFactory

This class is deprecated. Use `viewModelFactory` or implement `ViewModelProvider.Factory`, combined with `CreationExtras.createSavedStateHandle()`.

AndroidViewModel

ViewModel that has access to the Application context.

AndroidViewModelKt
CoroutineLiveDataKt
FlowExtKt
FlowLiveDataConversions
Lifecycle

Defines an object with a lifecycle state control flow.

LifecycleCoroutineScope

CoroutineScope tied to a Lifecycle and Dispatchers.Main.immediate.

LifecycleKt
LifecycleOwnerFactory
LifecycleOwnerKt
LifecycleRegistry

A Lifecycle implementation that manages multiple LifecycleObservers.

LifecycleService

A Service that is also a LifecycleOwner.

LiveData

LiveData is a data holder class that can be observed within a given lifecycle.

LiveDataKt
LiveDataReactiveStreams
MediatorLiveData

LiveData subclass which may observe other LiveData objects and react on OnChanged events from them.

MutableLiveData

LiveData which publicly exposes setValue and postValue method.

PausingDispatcherKt
ProcessLifecycleInitializer

Initializes ProcessLifecycleOwner using androidx.startup.

ProcessLifecycleOwner

Class that provides lifecycle for the whole application process.

RepeatOnLifecycleKt
SavedStateHandle

A handle to saved state passed to ViewModel.

SavedStateHandleSupport
SavedStateViewModelFactory

A ViewModelProvider.Factory that creates ViewModels with access to a SavedStateHandle in their constructor.

ServiceLifecycleDispatcher

Helper class to dispatch lifecycle events for a Service.

Transformations
ViewModel

Prepares and manages data for the UI.

ViewModelKt
ViewModelLazy

An implementation of Lazy to facilitate lazy retrieval of ViewModel instances.

ViewModelProvider

A utility class that manages the lifecycle, caching, and instantiation of ViewModel instances.

ViewModelProvider.AndroidViewModelFactory

Factory that creates AndroidViewModel and ViewModel instances.

ViewModelProvider.NewInstanceFactory

Factory that creates ViewModel instances by calling their no-argument constructor.

ViewModelProvider.NewInstanceFactory

Simple factory, which calls empty constructor on the give class.

ViewModelProviderGetKt
ViewModelProviders

This class is deprecated.

Use the constructors for ViewModelProvider directly.

ViewModelProviders.DefaultFactory

This class is deprecated.

Use ViewModelProvider.AndroidViewModelFactory

ViewModelStore

Stores ViewModel instances by key.

ViewModelStoreOwnerDefaults
ViewModelStores

This class is deprecated.

Use getViewModelStore or getViewModelStore to retrieve a ViewModelStore directly from activities and fragments.

ViewTreeLifecycleOwner
ViewTreeViewModelStoreOwner
WithLifecycleStateKt
SavedStateHandle.Companion
ViewModelProvider.Companion
ViewModelProvider.NewInstanceFactory.Companion

Enums

Lifecycle.Event

Represents a transition event triggered by a change in the LifecycleOwner's state.

Lifecycle.State

Represents the current lifecycle state of a LifecycleOwner.

Exceptions

LifecycleDestroyedException

A CancellationException that indicates that the Lifecycle associated with an operation reached the Lifecycle.State.DESTROYED state before the operation could complete.