-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Save back handling state in Activity/Fragment bundle #56715
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from my side 👍 . This would have taken me quite a long time to figure out on my own so thank you!
So this is unrelated to predictive back being unsupported on FlutterFragmentActivity?
Yes, that is correct. Though from what I can tell, predictive back when leaving the app seems to work with a Separately, I noticed that #52302 seems to have unintentionally had the effect of not allowing people to "opt out" of predictive back. This is actually aligned with what the android docs say should happen:
But this wasn't actually true for flutter apps before #52302, because we were not calling override fun onBackPressed() {
onBackPressedDispatcher.onBackPressed()
} So while the docs imply that removing the @Override
@SuppressWarnings("MissingSuperCall")
public void onBackPressed() {
flutterFragment.onBackPressed();
} What all this means is that apps that aren't opting in to predictive back had their back handling migrated to the new code path automatically, which is part of what happened in b/355556397: the bug this pr fixes affects all of FFA/FA/FF, but they noticed a behavior difference between FlutterActivity and FlutterFragmentActivity because of
|
I also think we may want to restore the ability for people to opt out, so that FlutterActivity and FlutterFragmentActivity have the same behavior wrt the |
Fixes flutter/flutter#159158, and fixes b/355556397
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.