summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/LoaderManager.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java
index cccf6e8..7125054 100644
--- a/core/java/android/app/LoaderManager.java
+++ b/core/java/android/app/LoaderManager.java
@@ -147,7 +147,10 @@ public abstract class LoaderManager {
LoaderManager.LoaderCallbacks<D> callback);
/**
- * Stops and removes the loader with the given ID.
+ * Stops and removes the loader with the given ID. If this loader
+ * had previously reported data to the client through
+ * {@link LoaderCallbacks#onLoadFinished(Loader, Object)}, a call
+ * will be made to {@link LoaderCallbacks#onLoaderReset(Loader)}.
*/
public abstract void destroyLoader(int id);
@@ -397,7 +400,8 @@ class LoaderManagerImpl extends LoaderManager {
writer.print(prefix); writer.print("mData="); writer.println(mData);
writer.print(prefix); writer.print("mStarted="); writer.print(mStarted);
writer.print(" mRetaining="); writer.print(mRetaining);
- writer.print(" mDestroyed="); writer.print(mDestroyed);
+ writer.print(" mDestroyed="); writer.println(mDestroyed);
+ writer.print(prefix); writer.print("mNeedReset="); writer.print(mNeedReset);
writer.print(" mListenerRegistered="); writer.println(mListenerRegistered);
}
}
@@ -491,6 +495,12 @@ class LoaderManagerImpl extends LoaderManager {
mLoaders.removeAt(idx);
info.destroy();
}
+ idx = mInactiveLoaders.indexOfKey(id);
+ if (idx >= 0) {
+ LoaderInfo info = mInactiveLoaders.valueAt(idx);
+ mInactiveLoaders.removeAt(idx);
+ info.destroy();
+ }
}
@SuppressWarnings("unchecked")