Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

OnBackPressedCallback

public interface OnBackPressedCallback

androidx.activity.OnBackPressedCallback


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

Summary

Public methods

abstract boolean handleOnBackPressed()

Callback for handling the OnBackPressedDispatcher.onBackPressed() event.

Public methods

handleOnBackPressed

public abstract boolean handleOnBackPressed ()

Callback for handling the OnBackPressedDispatcher.onBackPressed() event.

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