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

Commit 9e14e9f3 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix fragment index expunging.

Change-Id: If37e58dfa998575530305584d3aa756bb5a61d7b
parent 26dd7b3b
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();
    }