Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Looks like it's related to https://cs.android.com/androidx/platform/frameworks/support/+/d7f5e8294c72d753234ff82e868cd09a06241c5e - When destroying the fragment view, moveToState is called and ends up re-creating the fragment view now that check has been removed
ap...@google.com <ap...@google.com> #3
Seems like this is already fixed in master as a side effect of
You'd want to add the snapshot repository to your repositories
block:
maven {
url "https://ci.android/com/builds/submitted/6080026/androidx_snapshot/latest/repository/"
}
then switch to androidx.fragment:fragment-ktx:1.3.0-SNAPSHOT
.
We'll look into cherry picking the changes into Fragment 1.2.0
il...@google.com <il...@google.com>
an...@google.com <an...@google.com> #4
I can confirm that the issue appears to be fixed in that snapshot. Thanks!
Description
Version used: 1.2.0-rc03
Devices/Android versions reproduced on:
When you use a <fragment> tag and do a configuration change to a layout that does not contain the <fragment> tag, the Fragment is still recreated by FragmentManager, but stays in the INITIALIZING state.
If the FragmentManager is then destroyed (i.e., by the user hitting back, the parent fragment being removed, etc), the non-config state is not correctly cleared out. This can be seen by checking if any ViewModels are cleared or if any retained child fragments are destroyed.