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

Commit a1685911 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 04fc05cd 5daf06c1
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) {