I'm running my Android Application `Android-13, in the Logcat I'm seeing this warning, How to resolve this?
OnBackInvokedCallback is not enabled for the application.
Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
I'm running my Android Application `Android-13, in the Logcat I'm seeing this warning, How to resolve this?
OnBackInvokedCallback is not enabled for the application.
Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
This is because of the Android Gesture Navigation, reference link here
To help make predictive back gesture helpful and consistent for users, we're moving to an ahead-of-time model for back event handling by adding new APIs and deprecating existing APIs.
The new platform APIs and updates to AndroidX Activity 1.6+ are designed to make your transition from unsupported APIs (KeyEvent#KEYCODE_BACK and OnBackPressed) to the predictive back gesture as smooth as possible.
The new platform APIs include
OnBackInvokedCallbackandOnBackInvokedDispatcher, which AndroidX Activity 1.6+ supports through the existingOnBackPressedCallbackandOnBackPressedDispatcherAPIs.You can start testing this feature in two to four steps, depending on your existing implementation.