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;
|
||||
}
|
||||
fragment.mAdded = false;
|
||||
fragment.mRemoving = true;
|
||||
moveToState(fragment, Fragment.CREATED, transition, transitionStyle);
|
||||
}
|
||||
}
|
||||
@ -1122,7 +1121,6 @@ final class FragmentManagerImpl extends FragmentManager {
|
||||
if (!fragment.mAdded) {
|
||||
mAdded.add(fragment);
|
||||
fragment.mAdded = true;
|
||||
fragment.mRemoving = false;
|
||||
if (fragment.mHasMenu) {
|
||||
mNeedMenuInvalidate = true;
|
||||
}
|
||||
@ -1435,6 +1433,7 @@ final class FragmentManagerImpl extends FragmentManager {
|
||||
|
||||
if (f.mView != null) {
|
||||
saveFragmentViewState(f);
|
||||
}
|
||||
if (f.mSavedViewState != null) {
|
||||
if (result == null) {
|
||||
result = new Bundle();
|
||||
@ -1442,7 +1441,6 @@ final class FragmentManagerImpl extends FragmentManager {
|
||||
result.putSparseParcelableArray(
|
||||
FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user