OnBackPressedDispatcherOwner

interface OnBackPressedDispatcherOwner implements LifecycleOwner

Known direct subclasses
ComponentActivity

Base class for activities that enables composition of higher level components.

Known indirect subclasses
AppCompatActivity

Base class for activities that wish to use some of the newer platform features on older Android devices.

CarAppActivity

The class representing a car app activity.

FragmentActivity

Base class for activities that want to use the support-based Fragments.


A class that has an OnBackPressedDispatcher that allows you to register a OnBackPressedCallback for handling the system back button.

It is expected that classes that implement this interface route the system back button to the dispatcher

Summary

Public methods

abstract @NonNull OnBackPressedDispatcher

Retrieve the OnBackPressedDispatcher that should handle the system back button.

Inherited methods

From class LifecycleOwner
abstract @NonNull Lifecycle

Returns the Lifecycle of the provider.

Public methods

getOnBackPressedDispatcher

@NonNull
abstract OnBackPressedDispatcher getOnBackPressedDispatcher()

Retrieve the OnBackPressedDispatcher that should handle the system back button.