Merge "Fix to not lose state when saving a deactivated fragment." into honeycomb-mr2
This commit is contained in:
committed by
Android (Google) Code Review
commit
bd754205d0
@ -1109,7 +1109,6 @@ final class FragmentManagerImpl extends FragmentManager {
|
|||||||
mNeedMenuInvalidate = true;
|
mNeedMenuInvalidate = true;
|
||||||
}
|
}
|
||||||
fragment.mAdded = false;
|
fragment.mAdded = false;
|
||||||
fragment.mRemoving = true;
|
|
||||||
moveToState(fragment, Fragment.CREATED, transition, transitionStyle);
|
moveToState(fragment, Fragment.CREATED, transition, transitionStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1122,7 +1121,6 @@ final class FragmentManagerImpl extends FragmentManager {
|
|||||||
if (!fragment.mAdded) {
|
if (!fragment.mAdded) {
|
||||||
mAdded.add(fragment);
|
mAdded.add(fragment);
|
||||||
fragment.mAdded = true;
|
fragment.mAdded = true;
|
||||||
fragment.mRemoving = false;
|
|
||||||
if (fragment.mHasMenu) {
|
if (fragment.mHasMenu) {
|
||||||
mNeedMenuInvalidate = true;
|
mNeedMenuInvalidate = true;
|
||||||
}
|
}
|
||||||
@ -1435,13 +1433,13 @@ final class FragmentManagerImpl extends FragmentManager {
|
|||||||
|
|
||||||
if (f.mView != null) {
|
if (f.mView != null) {
|
||||||
saveFragmentViewState(f);
|
saveFragmentViewState(f);
|
||||||
if (f.mSavedViewState != null) {
|
}
|
||||||
if (result == null) {
|
if (f.mSavedViewState != null) {
|
||||||
result = new Bundle();
|
if (result == null) {
|
||||||
}
|
result = new Bundle();
|
||||||
result.putSparseParcelableArray(
|
|
||||||
FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
|
|
||||||
}
|
}
|
||||||
|
result.putSparseParcelableArray(
|
||||||
|
FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user