- Add a BackEventCompat class that is a backward compatible version of BackEvent, decoupled from the framework BackEvent class
- The OnBackPressedDispatcher constructor accepts an optional Consumer<Boolean> that receives a callback whenever the number of enabled callbacks changes between zero and non-zero
- The handleOnBackStarted and handleOnBackProgressed methods of OnBackPressedCallback now receive an androidx.activity.BackEventCompat instance instead of a framework android.window.BackEvent class signature changed · inferred, marked in the notes below
- The equivalent @VisibleForTesting APIs on OnBackPressedDispatcher are updated to use BackEventCompat
- Fix ReportDrawn crashing when navigating away from a screen before report is called
1 change to check, marked in the notes below
From AndroidX Activity
Activity now provides a BackEventCompat class that serves as a backward compatible version of BackEvent that is decoupled from the framework BackEvent class. Breaking change: The handleOnBackStarted and handleOnBackProgressed methods of OnBackPressedCallback now receive an androidx.activity.BackEventCompat instance rather than a framework android.window.BackEvent class. The equivalent @VisibleForTesting APIs on OnBackPressedDispatcher have also been updated. The constructor for OnBackPressedDispatcher now takes an optional Consumer instance that allows the owners of the dispatcher to receive a callback whenever the number of enabled callbacks changes from zero to non-zero or vice versa. From Activity 1.7.2: Fix ReportDrawn crashing when navigating away from a screen before report is called. ( Ic46f1, b/260506820) signature changed · inferred