2 package com.cyanogenmod.eleven.loaders;
4 import android.content.Context;
5 import android.support.v4.content.AsyncTaskLoader;
8 * <a href="http://code.google.com/p/android/issues/detail?id=14944">Issue
11 * @author Alexander Blom
13 public abstract class WrappedAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
18 * Constructor of <code>WrappedAsyncTaskLoader</code>
20 * @param context The {@link Context} to use.
22 public WrappedAsyncTaskLoader(Context context) {
30 public void deliverResult(D data) {
33 super.deliverResult(data);
35 // An asynchronous query came in while the loader is stopped
43 protected void onStartLoading() {
44 if (this.mData != null) {
45 deliverResult(this.mData);
46 } else if (takeContentChanged() || this.mData == null) {
55 protected void onStopLoading() {
56 // Attempt to cancel the current load task if possible
64 protected void onReset() {
66 // Ensure the loader is stopped