diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-09-25 14:15:15 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-09-25 15:04:06 -0700 |
commit | e181bd9b5e6a3e5382a1ff3c40b9ce2cb43c7971 (patch) | |
tree | 27e9af794359316155f981d2a5da9530bcdc86a3 /core/java/android/app | |
parent | b1c4ab5c2afea1f0797ee397df6512366128d980 (diff) | |
download | frameworks_base-e181bd9b5e6a3e5382a1ff3c40b9ce2cb43c7971.zip frameworks_base-e181bd9b5e6a3e5382a1ff3c40b9ce2cb43c7971.tar.gz frameworks_base-e181bd9b5e6a3e5382a1ff3c40b9ce2cb43c7971.tar.bz2 |
Fix AbsListView to correctly retain its state if not layed out.
This covers a hole where if the list view restores its state and
then is asked to save its state before its layout happens, the
original state is lost. Instead we just store that original state.
Also tweak FragmentManager to make sure an inactive fragment can
not have its state moved up out of CREATED.
Bug #7232088: ListView saved state being lost in some cases
Change-Id: I5b40f37c259c7bcbe17dd1330016f9531f1b5534
Diffstat (limited to 'core/java/android/app')
-rw-r--r-- | core/java/android/app/FragmentManager.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index 7f11437..aad5487 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -776,7 +776,7 @@ final class FragmentManagerImpl extends FragmentManager { // + " mRemoving=" + f.mRemoving + " Callers=" + Debug.getCallers(5)); // Fragments that are not currently added will sit in the onCreate() state. - if (!f.mAdded && newState > Fragment.CREATED) { + if ((!f.mAdded || f.mDetached) && newState > Fragment.CREATED) { newState = Fragment.CREATED; } if (f.mRemoving && newState > f.mState) { |