Language

IOnBackInvokedDispatcher.PrioritySystemNavigationObserver Field

Definition

Priority level of OnBackInvokedCallbacks designed to observe system-level back handling.

[Android.Runtime.Register("PRIORITY_SYSTEM_NAVIGATION_OBSERVER", ApiSince=36)]
public const int PrioritySystemNavigationObserver = -2;
[<Android.Runtime.Register("PRIORITY_SYSTEM_NAVIGATION_OBSERVER", ApiSince=36)>]
val mutable PrioritySystemNavigationObserver : int

Field Value

Value = -2
Attributes

Remarks

Priority level of OnBackInvokedCallbacks designed to observe system-level back handling.

Callbacks registered with this priority are invoked when the system handles back navigation, including when a system-provided override callback handles it. This can include finishing the current activity, moving its task to the background, or executing a back-to-home animation.

These callbacks are purely observational. They do not consume the back event and cannot intercept it. Their invocation has no impact on the normal back navigation flow, making them suitable for logging, analytics, or triggering actions that should not prevent the system's own back handling.

The invocation order for multiple callbacks registered with this priority is undefined.

On API level 36 only, there is a restriction that only one callback with PrioritySystemNavigationObserver can be registered at a time. On API level 37 and higher, the number of registered observer callbacks is unrestricted.

Java documentation for android.window.OnBackInvokedDispatcher.PRIORITY_SYSTEM_NAVIGATION_OBSERVER.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to