am bd754205: Merge "Fix to not lose state when saving a deactivated fragment." into honeycomb-mr2
* commit 'bd754205d0b59315582855329649dad925a04b82':
Fix to not lose state when saving a deactivated fragment.
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index 2164ada..3b2e108 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -1109,7 +1109,6 @@
mNeedMenuInvalidate = true;
}
fragment.mAdded = false;
- fragment.mRemoving = true;
moveToState(fragment, Fragment.CREATED, transition, transitionStyle);
}
}
@@ -1122,7 +1121,6 @@
if (!fragment.mAdded) {
mAdded.add(fragment);
fragment.mAdded = true;
- fragment.mRemoving = false;
if (fragment.mHasMenu) {
mNeedMenuInvalidate = true;
}
@@ -1435,13 +1433,13 @@
if (f.mView != null) {
saveFragmentViewState(f);
- if (f.mSavedViewState != null) {
- if (result == null) {
- result = new Bundle();
- }
- result.putSparseParcelableArray(
- FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
+ }
+ if (f.mSavedViewState != null) {
+ if (result == null) {
+ result = new Bundle();
}
+ result.putSparseParcelableArray(
+ FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
}
return result;