Fix some problems with moving in and out of detached state.
Loaders were not being re-initialized correctly when coming back
(this would also impact the back stack). The ListView also wasn't
working correctly, and there were also problems with simply
re-using a Fragment instance after it had been removed.
Change-Id: I534b091ae09c0ef7ffffe9d68049e6840e8926b3
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index b739e10..e0a2ce8 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -4413,7 +4413,9 @@
mFragments.dispatchStart();
if (mAllLoaderManagers != null) {
for (int i=mAllLoaderManagers.size()-1; i>=0; i--) {
- mAllLoaderManagers.valueAt(i).finishRetain();
+ LoaderManagerImpl lm = mAllLoaderManagers.valueAt(i);
+ lm.finishRetain();
+ lm.doReportStart();
}
}
}