fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
Fragment trackAddedFragmentsInPop(ArrayList<Fragment> added, Fragment oldPrimaryNav) {
        for (int opNum = 0; opNum < mOps.size(); opNum++) {
            final Op op = mOps.get(opNum);
            switch (op.cmd) {
                case OP_ADD:
                case OP_ATTACH:
                    added.remove(op.fragment);
                    break;
                case OP_REMOVE:
                case OP_DETACH:
                    added.add(op.fragment);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    oldPrimaryNav = op.fragment;
                    break;
                case OP_SET_PRIMARY_NAV:
                    oldPrimaryNav = null;
                    break;
            }
        }
        return oldPrimaryNav;
    }
/**
     * Removes fragments that are added or removed during a pop operation.
     *
     * @param added Initialized to the fragments that are in the mManager.mAdded, this
     *              will be modified to contain the fragments that will be in mAdded
     *              after the execution ({@link #executeOps()}.
     * @param oldPrimaryNav The tracked primary navigation fragment as of the beginning of
     *                      this set of ops
     * @return the new oldPrimaryNav fragment after this record's ops would be popped
     */
Removes fragments that are added or removed during a pop operation.
@param added Initialized to the fragments that are in the mManager.mAdded, this
will be modified to contain the fragments that will be in mAdded
after the execution ( #executeOps().
@param oldPrimaryNav The tracked primary navigation fragment as of the beginning of
this set of ops
@return the new oldPrimaryNav fragment after this record's ops would be popped
Removes fragments that are added or removed during a pop operation . @param added Initialized to the fragments that are in the mManager . mAdded this will be modified to contain the fragments that will be in mAdded after the execution ( #executeOps () . @param oldPrimaryNav The tracked primary navigation fragment as of the beginning of this set of ops @return the new oldPrimaryNav fragment after this record ' s ops would be popped
Fragment trackAddedFragmentsInPop(ArrayList<Fragment> added, Fragment oldPrimaryNav) {
        for (int opNum = 0; opNum < mOps.size(); opNum++) {
            final Op op = mOps.get(opNum);
            switch (op.cmd) {
                case OP_ADD:
                case OP_ATTACH:
                    added.remove(op.fragment);
                    break;
                case OP_REMOVE:
                case OP_DETACH:
                    added.add(op.fragment);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    oldPrimaryNav = op.fragment;
                    break;
                case OP_SET_PRIMARY_NAV:
                    oldPrimaryNav = null;
                    break;
            }
        }
        return oldPrimaryNav;
    }
Fragment trackAddedFragmentsInPop ( ArrayList < Fragment > added , Fragment oldPrimaryNav ) { for ( int opNum = 0 ; opNum < mOps . size ( ) ; opNum ++ ) { final Op op = mOps . get ( opNum ) ; switch ( op . cmd ) { case OP_ADD : case OP_ATTACH : added . remove ( op . fragment ) ; break ; case OP_REMOVE : case OP_DETACH : added . add ( op . fragment ) ; break ; case OP_UNSET_PRIMARY_NAV : oldPrimaryNav = op . fragment ; break ; case OP_SET_PRIMARY_NAV : oldPrimaryNav = null ; break ; } } return oldPrimaryNav ; }
Removes fragments that are added or removed during a pop operation.
Removes fragments that are added or removed during a pop operation .