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

Commit 72c9265a authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix fragment index expunging."

parents 75608848 9e14e9f3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1567,6 +1567,12 @@ public class Activity extends ContextThemeWrapper
        return new BackStackEntry(mFragments);
    }
    
    void invalidateFragmentIndex(int index) {
        if (mAllLoaderManagers != null) {
            mAllLoaderManagers.remove(index);
        }
    }
    
    /**
     * Called when a Fragment is being attached to this activity, immediately
     * after the call to its {@link Fragment#onAttach Fragment.onAttach()}
+1 −1
Original line number Diff line number Diff line
@@ -316,7 +316,6 @@ public class FragmentManager {
                            throw new SuperNotCalledException("Fragment " + f
                                    + " did not call through to super.onDetach()");
                        }
                        f.mActivity.mAllLoaderManagers.remove(f.mIndex);
                        f.mActivity = null;
                    }
            }
@@ -377,6 +376,7 @@ public class FragmentManager {
            mAvailIndices = new ArrayList<Integer>();
        }
        mAvailIndices.add(f.mIndex);
        mActivity.invalidateFragmentIndex(f.mIndex);
        f.clearIndex();
    }