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

Interface that marks a ViewModelStoreOwner as having a default ViewModelProvider.Factory for use with ViewModelProvider.

LifecycleEventObserver

Class that can receive any lifecycle change and dispatch it to the receiver.

LifecycleObserver

Marks a class as a LifecycleObserver.

LifecycleOwner

A class that has an Android 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 Factory interface are responsible to instantiate ViewModels.

ViewModelStoreOwner

A scope that owns ViewModelStore.

Classes

AbstractSavedStateViewModelFactory

Skeleton of androidx.lifecycle.ViewModelProvider.KeyedFactory that creates SavedStateHandle for every requested ViewModel.

AndroidViewModel

Application context aware ViewModel.

AndroidViewModelKt
CoroutineLiveDataKt
FlowExtKt
FlowLiveDataConversions
Lifecycle

Defines an object that has an Android Lifecycle. androidx.fragment.app.Fragment and androidx.fragment.app.FragmentActivity classes implement LifecycleOwner interface which has the LifecycleOwner.getLifecycle method to access the Lifecycle.

LifecycleCoroutineScope

CoroutineScope tied to a Lifecycle and Dispatchers.Main.immediate

LifecycleKt
LifecycleOwnerKt
LifecycleRegistry

An implementation of Lifecycle that can handle multiple observers.

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 down to androidx.lifecycle.ViewModel.

SavedStateHandleDelegatesKt
SavedStateHandleSupport
SavedStateViewModelFactory

androidx.lifecycle.ViewModelProvider.Factory that can create ViewModels accessing and contributing to a saved state via SavedStateHandle received in a constructor.

ServiceLifecycleDispatcher

Helper class to dispatch lifecycle events for a Service.

Transformations
ViewModel

ViewModel is a class that is responsible for preparing and managing the data for an androidx.activity.ComponentActivity or a androidx.fragment.app.Fragment.

ViewModelKt
ViewModelLazy

An implementation of Lazy used by androidx.fragment.app.viewModels and androidx.activity.viewModels.

ViewModelProvider

A utility class that provides ViewModels for a scope.

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

Class to store ViewModels.

ViewModelStores

This class is deprecated.

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

ViewTreeLifecycleOwner
ViewTreeViewModelStoreOwner
WithLifecycleStateKt
SavedStateHandle.Companion

Enums

Lifecycle.Event
Lifecycle.State

Lifecycle states.

Exceptions

LifecycleDestroyedException

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