Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8695cbad authored by George Mount's avatar George Mount Committed by android-build-merger
Browse files

Merge "Fix saving target fragment when Fragment not yet created." into oc-dev

am: a1685911

Change-Id: Ia61f383eba7639a3c29fcf4a13b53177141e65d2
parents c81f0618 a1685911
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1128,9 +1128,14 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
            newState = Fragment.CREATED;
        }
        if (f.mRemoving && newState > f.mState) {
            if (f.mState == Fragment.INITIALIZING && f.isInBackStack()) {
                // Allow the fragment to be created so that it can be saved later.
                newState = Fragment.CREATED;
            } else {
                // While removing a fragment, we can't change it to a higher state.
                newState = f.mState;
            }
        }
        // Defer start if requested; don't allow it to move to STARTED or higher
        // if it's not already started.
        if (f.mDeferStart && f.mState < Fragment.STARTED && newState > Fragment.STOPPED) {