Fixed
Status Update
Comments
be...@citymapper.com <be...@citymapper.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
il...@google.com <il...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
be...@citymapper.com <be...@citymapper.com> #4
I can confirm that the issue appears to be fixed in that snapshot. Thanks!
il...@google.com <il...@google.com> #5
Great, thanks for confirming.
While there isn't any specific changes needed for this issue (as the issue was already fixed before this bug was filed), I do want to explain what exactly is going to happen from a release process:
First, we'll be cherry picking in the changes needed into a Fragment 1.2.0-rc05 release (it was too late to hit rc04, which already went out earlier today). Namely, these two changes:
https://android-review.googlesource.com/1178750/ https://android-review.googlesource.com/1183079/ (this was the fix for the bug mentioned in , FWIW)comment#3
Secondly, we've added additional testing (in an unrelated, but fortuitously timed effort) specifically to cover this case to ensure this doesn't happen again in
mr...@gmail.com <mr...@gmail.com> #6
I could confirm the behavior on both my device and emulator. Thanks for the update and it is also good to see addition check here.
I'm curious why you need to limit the check to Build.VERSION.SDK_INT >= 17?
I'm curious why you need to limit the check to Build.VERSION.SDK_INT >= 17?
Description
Version used: 1.2.0-rc03
Devices/Android versions reproduced on:
- Pixel 3 API 27 Emulator
- Pixel 3 API 29 Emulator
- LG G7 ThinQ API 28
Sample code:
How to use:
- Make sure Fragment F1 is using layout fragment_f1_bad. Use the code to start the MainActivity, produce a configuration change (eg: rotate the device) --> it will crash due to an Exception is thrown in a check code.
- Changing F1 layout to fragment_f1_good and it will be fine.
Description:
- Saying I have a Fragment F1 in my Activity, defined either by xml (fragment tag or FragmentContainerView) or manual adding at runtime.
- F1's layout is defined in an xml with a 'fragment' tag whose name is a Fragment F2.
- The app starts normally as usual.
- If a configuration change happens, the destruction of F1 will call F2's onViewCreated.
In the sample app, I put a check code which checks if the Activity is destroyed or not, and in this case it will crash the app.
The expected behavior should be: the destruction of F1 should not call F2's onViewCreated.
This issue doesn't occur on 1.2.0-rc03 IF I use `FragmentContainerView` instead of `fragment` to add F2.
This issue cannot be reproduced on 1.2.0-rc02, 1.2.0-rc01 and (I believe) earlier versions.
Please find a call stack in attached screenshot (taken from a debug session on Pixel 3 API 29 Emulator).