Call noteStateNotSaved on child fragment managers.
Bug 36740474 When onNewIntent() is called, it calls noteStateNotSaved on the FragmentManager. It wasn't propagating that to child FragmentManagers. This CL properly propagates the noteStateNotSaved(). Test: I7cf360a4ed82ee34797896dc110477731c8206c0 Change-Id: Icfcbc385ef68657145b05cb59d5b2a70fe020992
This commit is contained in:
@@ -2608,6 +2608,12 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
|
||||
}
|
||||
}
|
||||
|
||||
void noteStateNotSaved() {
|
||||
if (mChildFragmentManager != null) {
|
||||
mChildFragmentManager.noteStateNotSaved();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void performMultiWindowModeChanged(boolean isInMultiWindowMode) {
|
||||
onMultiWindowModeChanged(isInMultiWindowMode);
|
||||
|
||||
@@ -2893,8 +2893,15 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
|
||||
|
||||
public void noteStateNotSaved() {
|
||||
mStateSaved = false;
|
||||
final int addedCount = mAdded == null ? 0 : mAdded.size();
|
||||
for (int i = 0; i < addedCount; i++) {
|
||||
Fragment fragment = mAdded.get(i);
|
||||
if (fragment != null) {
|
||||
fragment.noteStateNotSaved();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void dispatchCreate() {
|
||||
mStateSaved = false;
|
||||
dispatchMoveToState(Fragment.CREATED);
|
||||
|
||||
Reference in New Issue
Block a user