Inspectopedia Help

Usage of KeyEvent.KEYCODE_BACK

Usage of KeyEvent.KEYCODE_BACK

Starting in Android 13 (API 33+), the handling of back events is moving to an ahead-of-time callback model. Use OnBackInvokedDispatcher.registerOnBackInvokedCallback(...) and onBackInvokedCallback or AndroidX's OnBackPressedDispatcher with an implemented onBackPressedCallback to handle back gestures and key presses.

Issue id: GestureBackNavigation

https://developer.android.com/about/versions/13/features/predictive-back-gesture

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3

Plugin:

Android, 2022.3.1 Beta 2

Last modified: 13 July 2023