summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-12-17 16:54:05 -0800
committerDianne Hackborn <hackbod@google.com>2010-12-17 16:54:05 -0800
commitf73c75ca20fcaaee1b0eeaaf756252c33e3099c6 (patch)
treee3976e911569403f50f17d0eab3c2bdbdb008e78 /core/java/android/app
parent43c0db48d265a3d8f136d107e181e8c23455ec37 (diff)
downloadframeworks_base-f73c75ca20fcaaee1b0eeaaf756252c33e3099c6.zip
frameworks_base-f73c75ca20fcaaee1b0eeaaf756252c33e3099c6.tar.gz
frameworks_base-f73c75ca20fcaaee1b0eeaaf756252c33e3099c6.tar.bz2
Some fixes to the new loader management.
Change-Id: Ib882be5762b0ebeed9b027754159f401232718e9
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")