Please complete the following information for each phone and/or emulator you're experiencing this bug on:
Device: Pixel 8 simulator
OS: Android 14
Describe the bug
One requirement to use this plugin is to extend FlutterFragmentActivity instead of FlutterActivity.
Is there anyway to remove the need to extend FlutterFragmentActivity?
This is a problem because it breaks predictive back:
User presses back and the app is put in the background, instead of the route being popped
FlutterActivity supports predictive back, but FlutterFragmentActivity currently doesn't.
Related issues:
Run any flutter app with a navigator and a overview/detail screen model
Add android:enableOnBackInvokedCallback="true" to the activity tag in AndroidManifest.xml
Run the app, navigate to another screen
Press the system back button (or do the gesture)
Expected behavior
App should stay open, user should be pushed back to the overview screen.
Actual behavior
App closes.
Screenshots
n/a
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.5 23F79 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.89.1)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!
Additional information
Also happens in newer Flutter versions, ie 3.22.1 (newest at the time of writing).
Device / Emulator and OS
Please complete the following information for each phone and/or emulator you're experiencing this bug on:
Describe the bug
One requirement to use this plugin is to extend
FlutterFragmentActivity
instead ofFlutterActivity
. Is there anyway to remove the need to extendFlutterFragmentActivity
?This is a problem because it breaks predictive back:
FlutterActivity supports predictive back, but FlutterFragmentActivity currently doesn't. Related issues:
To Reproduce
android:enableOnBackInvokedCallback="true"
to the activity tag inAndroidManifest.xml
Expected behavior
App should stay open, user should be pushed back to the overview screen.
Actual behavior
App closes.
Screenshots
n/a
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.19.1, on macOS 14.5 23F79 darwin-arm64, locale de-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] VS Code (version 1.89.1) [✓] Connected device (2 available) [✓] Network resources
• No issues found!
Additional information
Also happens in newer Flutter versions, ie 3.22.1 (newest at the time of writing).