{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LifecycleObserver

interface LifecycleObserver

Known direct subclasses
DefaultLifecycleObserver

Callback interface for listening to LifecycleOwner state changes.

LifecycleEventObserver

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


Marks a class as a LifecycleObserver. Don't use this interface directly. Instead implement either DefaultLifecycleObserver or LifecycleEventObserver to be notified about lifecycle events.

See also
Lifecycle

Lifecycle - for samples and usage patterns.