OnBackPressedCallback

public interface OnBackPressedCallback

androidx.activity.OnBackPressedCallback


Interface for handling ComponentActivity.onBackPressed() callbacks without strongly coupling that implementation to a subclass of ComponentActivity.

Summary

Public methods

abstract boolean handleOnBackPressed()

Callback for handling the ComponentActivity.onBackPressed() event.

Public methods

handleOnBackPressed

public abstract boolean handleOnBackPressed ()

Callback for handling the ComponentActivity.onBackPressed() event.

Returns
boolean True if you handled the ComponentActivity.onBackPressed() event. No further OnBackPressedCallback instances will be called if you return true.