ViewTreeOnBackPressedDispatcherOwner
public final class ViewTreeOnBackPressedDispatcherOwner
Summary
Public methods |
|
|---|---|
static final OnBackPressedDispatcherOwner |
Retrieve the |
static final void |
set(Set the |
Public methods
get
public static final OnBackPressedDispatcherOwner get(@NonNull View receiver)
Retrieve the OnBackPressedDispatcherOwner associated with the given View. This may be used to add a callback for the system back button.
| Returns | |
|---|---|
OnBackPressedDispatcherOwner |
The |
set
public static final void set(
@NonNull View receiver,
@NonNull OnBackPressedDispatcherOwner onBackPressedDispatcherOwner
)
Set the OnBackPressedDispatcherOwner associated with the given View. Calls to findViewTreeOnBackPressedDispatcherOwner from this view or descendants will return onBackPressedDispatcherOwner.
This should only be called by constructs such as activities or dialogs that manage a view tree and handle the dispatch of the system back button. Callers should only set a OnBackPressedDispatcherOwner that will be stable.
| Parameters | |
|---|---|
@NonNull OnBackPressedDispatcherOwner onBackPressedDispatcherOwner |
|