LifecycleOwner
public interface LifecycleOwner
ActivityHolder |
A holder for the |
ComponentActivity |
Base class for activities that enables composition of higher level components. |
ComponentDialog |
Base class for dialogs that enables composition of higher level components. |
Fragment |
Static library support version of the framework's |
InCallServiceCompat |
This class defines the Jetpack InCallService with the additional ability of defining a |
LifecycleRegistryOwner |
This interface is deprecated. Use |
LifecycleService |
A Service that is also a |
NavBackStackEntry |
Representation of an entry in the back stack of a |
OnBackPressedDispatcherOwner |
A class that has an |
ProcessLifecycleOwner |
Class that provides lifecycle for the whole application process. |
SavedStateRegistryOwner |
A scope that owns |
Screen |
A Screen has a |
Session |
The base class for implementing a session for a car app. |
TestLifecycleOwner |
Create a |
AbstractListDetailFragment |
A fragment supports adaptive two-pane layout. |
AbstractProgressFragment |
The base class for |
AlertDialog |
A subclass of Dialog that can display one, two or three buttons. |
AmbientModeSupport |
This class is deprecated. Use |
AppCompatActivity |
Base class for activities that wish to use some of the newer platform features on older Android devices. |
AppCompatDialogFragment |
A special version of |
AppCompatDialog |
Base class for AppCompat themed |
BaseCarAppActivity |
Core logic for CarAppLibrary Activity interaction with a host. |
BaseLeanbackPreferenceFragmentCompat |
This fragment provides a preference fragment with leanback-style behavior, suitable for embedding into broader UI elements. |
BaseSupportFragment |
Base class for leanback Fragments. |
BrandedSupportFragment |
Fragment class for managing search and branding using a view that implements |
BrowseSupportFragment |
A fragment for creating Leanback browse screens. |
CarAppActivity |
The class representing a car app activity in the main display. |
ComponentActivity |
Base class for activities that enables composition of higher level components. |
ComponentDialog |
Base class for dialogs that enables composition of higher level components. |
DefaultProgressFragment |
The default |
DetailsSupportFragment |
A fragment for creating Leanback details screens. |
DialogFragment |
A fragment that displays a dialog window, floating in the foreground of its activity's window. |
DynamicNavHostFragment |
The |
EditTextPreferenceDialogFragmentCompat |
|
ErrorSupportFragment |
A fragment for displaying an error indication. |
FragmentActivity |
Base class for activities that want to use the support-based |
Fragment |
Static library support version of the framework's |
GuidedStepSupportFragment |
A GuidedStepSupportFragment is used to guide the user through a decision or series of decisions. |
HeadersSupportFragment |
An fragment containing a list of row headers. |
LauncherActivity |
This class handles providing the right launcher activity when running native applications and Car App Library applications. |
LeanbackEditTextPreferenceDialogFragmentCompat |
Implemented a dialog to input text. |
LeanbackListPreferenceDialogFragmentCompat |
Implemented a dialog to show |
LeanbackPreferenceDialogFragmentCompat |
A fragment that shows |
LeanbackPreferenceFragmentCompat |
This fragment provides a fully decorated leanback-style preference fragment, including a list background and header. |
LeanbackSettingsFragmentCompat |
This fragment provides a container for displaying a |
ListFragment |
Static library support version of the framework's |
ListPreferenceDialogFragmentCompat |
|
MediaRouteChooserDialogFragment |
Media route chooser dialog fragment. |
MediaRouteChooserDialog |
This class implements the route chooser dialog for |
MediaRouteControllerDialogFragment |
Media route controller dialog fragment. |
MediaRouteControllerDialog |
This class implements the route controller dialog for |
MediaRouteDiscoveryFragment |
Media route discovery fragment. |
MultiSelectListPreferenceDialogFragmentCompat |
|
NavBackStackEntry |
Representation of an entry in the back stack of a |
NavHostFragment |
NavHostFragment provides an area within your layout for self-contained navigation to occur. |
OnboardingSupportFragment |
An OnboardingSupportFragment provides a common and simple way to build onboarding screen for applications. |
PdfViewerFragment |
A Fragment that renders a PDF document. |
PlaybackSupportFragment |
A fragment for displaying playback controls and related content. |
PreferenceDialogFragmentCompat |
Abstract base class which presents a dialog associated with a |
PreferenceFragmentCompat |
A PreferenceFragmentCompat is the entry point to using the Preference library. |
PreferenceHeaderFragmentCompat |
|
RowsSupportFragment |
An ordered set of rows of leanback widgets. |
SearchSupportFragment |
A fragment to handle searches. |
VerticalGridSupportFragment |
A fragment for creating leanback vertical grids. |
VideoSupportFragment |
Subclass of |
A class that has an Android lifecycle. These events can be used by custom components to handle lifecycle changes without implementing any code inside the Activity or the Fragment.
| See also | |
|---|---|
Lifecycle |
|
ViewTreeLifecycleOwner |
Summary
Public methods
Extension functions
LifecycleOwnerKt.getLifecycleScope
default final @NonNull LifecycleCoroutineScope LifecycleOwnerKt.getLifecycleScope(@NonNull LifecycleOwner receiver)
CoroutineScope tied to this LifecycleOwner's Lifecycle.
This scope will be cancelled when the Lifecycle is destroyed.
This scope is bound to Dispatchers.Main.immediate.
WithLifecycleStateKt.withCreated
default final @NonNull R <R extends Object> WithLifecycleStateKt.withCreated(
@NonNull LifecycleOwner receiver,
@NonNull Function0<@NonNull R> block
)
Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.CREATED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.
WithLifecycleStateKt.withResumed
default final @NonNull R <R extends Object> WithLifecycleStateKt.withResumed(
@NonNull LifecycleOwner receiver,
@NonNull Function0<@NonNull R> block
)
Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.RESUMED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.
WithLifecycleStateKt.withStarted
default final @NonNull R <R extends Object> WithLifecycleStateKt.withStarted(
@NonNull LifecycleOwner receiver,
@NonNull Function0<@NonNull R> block
)
Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.STARTED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.
WithLifecycleStateKt.withStateAtLeast
default final @NonNull R <R extends Object> WithLifecycleStateKt.withStateAtLeast(
@NonNull LifecycleOwner receiver,
@NonNull Lifecycle.State state,
@NonNull Function0<@NonNull R> block
)
Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least state and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.