Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 25f416c1c0c96bff97d6c0cb7be2a24bfa696c26
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 21 14:13:38 2020
Move viewLifecycleOwner to CREATED during onSaveInstanceState()
onSaveInstanceState() should change both the Fragment's
Lifecycle and the Fragment View's Lifecycle so that
it is always safe to do FragmentTransactions up until
ON_STOP for either Lifecycle.
Test: new FragmentArchLifecycleTest passes
BUG: 154645875
Change-Id: I8203de6c7eccbf726080e5f9f55cf89fcea2db9d
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentViewLifecycleOwner.java
https://android-review.googlesource.com/1292281
Branch: androidx-master-dev
commit 25f416c1c0c96bff97d6c0cb7be2a24bfa696c26
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 21 14:13:38 2020
Move viewLifecycleOwner to CREATED during onSaveInstanceState()
onSaveInstanceState() should change both the Fragment's
Lifecycle and the Fragment View's Lifecycle so that
it is always safe to do FragmentTransactions up until
ON_STOP for either Lifecycle.
Test: new FragmentArchLifecycleTest passes
BUG: 154645875
Change-Id: I8203de6c7eccbf726080e5f9f55cf89fcea2db9d
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentViewLifecycleOwner.java
il...@google.com <il...@google.com> #3
This has been fixed internally and will be available in Fragment 1.3.0-alpha04.
an...@google.com <an...@google.com> #4
il...@google.com <il...@google.com> #5
We've decided to release a Fragment 1.2.5 bug fix release and will be including this change in that release.
Description
Component used: Fragment Version used: 1.3.0-alpha03
When the Activity receives a callback to
onSaveInstanceState()
, all Fragments have theirLifecycle
stopped, ensuring that doing aFragmentTransaction
betweenON_START
andON_STOP
is always safe.However, the same is not done for the
Lifecycle
associated with the Fragment'sgetViewLifecycleOwner()
.Both should be changed at the same time.