Loading core/java/android/app/LoaderManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); } } Loading Loading @@ -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") Loading core/java/android/content/CursorLoader.java +16 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { Cursor mCursor; ForceLoadContentObserver mObserver; boolean mStopped; boolean mContentChanged; boolean mReset; Uri mUri; String[] mProjection; Loading Loading @@ -102,7 +103,9 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { if (mCursor != null) { deliverResult(mCursor); } else { } if (mCursor == null || mContentChanged) { mContentChanged = false; forceLoad(); } } Loading @@ -119,6 +122,18 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { mStopped = true; } @Override public void onContentChanged() { if (mStopped) { // This loader has been stopped, so we don't want to load // new data right now... but keep track of it changing to // refresh later if we start again. mContentChanged = true; return; } super.onContentChanged(); } @Override public void onCancelled(Cursor cursor) { if (cursor != null && !cursor.isClosed()) { Loading Loading
core/java/android/app/LoaderManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); } } Loading Loading @@ -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") Loading
core/java/android/content/CursorLoader.java +16 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { Cursor mCursor; ForceLoadContentObserver mObserver; boolean mStopped; boolean mContentChanged; boolean mReset; Uri mUri; String[] mProjection; Loading Loading @@ -102,7 +103,9 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { if (mCursor != null) { deliverResult(mCursor); } else { } if (mCursor == null || mContentChanged) { mContentChanged = false; forceLoad(); } } Loading @@ -119,6 +122,18 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { mStopped = true; } @Override public void onContentChanged() { if (mStopped) { // This loader has been stopped, so we don't want to load // new data right now... but keep track of it changing to // refresh later if we start again. mContentChanged = true; return; } super.onContentChanged(); } @Override public void onCancelled(Cursor cursor) { if (cursor != null && !cursor.isClosed()) { Loading