Skip to content

fix(android): keep system back working on Android 16 (targetSdk 36)#153

Merged
1technophile merged 1 commit into
developmentfrom
fix/android-back-gesture
Jul 3, 2026
Merged

fix(android): keep system back working on Android 16 (targetSdk 36)#153
1technophile merged 1 commit into
developmentfrom
fix/android-back-gesture

Conversation

@1technophile

Copy link
Copy Markdown
Member

Description:

On Android 16 / targetSdk 36, android:enableOnBackInvokedCallback defaults to true, so the OS routes the back gesture and the 3-button back through OnBackInvokedDispatcher instead of dispatching KEYCODE_BACK. Qt does not register an OnBackInvokedCallback, so the platform's default callback finishes the activity and the app closes from any sub-screen, instead of navigating back via MobileApplication.qml's Keys.onBackPressed -> backAction().

Opt out of the predictive back callback to restore legacy KEYCODE_BACK delivery. Verified on a Pixel 8a (Android 16): edge-swipe and 3-button back now return to the previous screen; double-back-to-exit on the main screen still works.

Fixes #152

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

On Android 16 / targetSdk 36, android:enableOnBackInvokedCallback defaults
to true, so the OS routes the back gesture and the 3-button back through
OnBackInvokedDispatcher instead of dispatching KEYCODE_BACK. Qt does not
register an OnBackInvokedCallback, so the platform's default callback
finishes the activity and the app closes from any sub-screen, instead of
navigating back via MobileApplication.qml's Keys.onBackPressed -> backAction().

Opt out of the predictive back callback to restore legacy KEYCODE_BACK
delivery. Verified on a Pixel 8a (Android 16): edge-swipe and 3-button back
now return to the previous screen; double-back-to-exit on the main screen
still works.

Fixes #152

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@1technophile
1technophile merged commit 27c6cd3 into development Jul 3, 2026
10 checks passed
@1technophile
1technophile deleted the fix/android-back-gesture branch July 3, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: Back-Gestures not working

1 participant