android.support.v4.content.AsyncTaskLoader类的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中android.support.v4.content.AsyncTaskLoader类的一些代码示例,展示了AsyncTaskLoader类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AsyncTaskLoader类的具体详情如下:
包路径:android.support.v4.content.AsyncTaskLoader
类名称:AsyncTaskLoader

AsyncTaskLoader介绍

[英]Static library support version of the framework's android.content.AsyncTaskLoader. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.
[中]静态库支持框架的android版本。所容纳之物异步任务加载器。用于编写在Android 3.0之前的平台上运行的应用程序。在Android 3.0或更高版本上运行时,仍然使用此实现;它不会尝试切换到框架的实现。有关类概述,请参见框架SDK文档。

代码示例

代码示例来源:origin: k9mail/k-9

@Override
public void deliverResult(MessageViewInfo messageViewInfo) {
  this.messageViewInfo = messageViewInfo;
  super.deliverResult(messageViewInfo);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 protected void onReset() {
  super.onReset();

  onStopLoading();
  // plus any actual cleanup
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
protected void onStartLoading() {
 super.onStartLoading();
 if (lastResult!=null) {
  deliverResult(lastResult);
 }
 else {
  forceLoad();
 }
}

代码示例来源:origin: com.google.android/support-v4

void dispatchOnLoadComplete(LoadTask task, D data) {
  if (mTask != task) {
    if (DEBUG) Log.v(TAG, "Load complete of old task, trying to cancel");
    dispatchOnCancelled(task, data);
  } else {
    if (isAbandoned()) {
      // This cursor has been abandoned; just cancel the new data.
      onCanceled(data);
    } else {
      mLastLoadCompleteTime = SystemClock.uptimeMillis();
      mTask = null;
      if (DEBUG) Log.v(TAG, "Delivering result");
      deliverResult(data);
    }
  }
}

代码示例来源:origin: n76/wifi_backend

@Override
protected void onStopLoading() {
  super.deliverResult(null);
  super.onStopLoading();
  cancelLoad();
}

代码示例来源:origin: SimonMarquis/Android-SecretCodes

@Override
public void onCanceled(List<SecretCode> codes) {
  super.onCanceled(codes);
}

代码示例来源:origin: stackoverflow.com

protected D doInBackground(Void... params) {
    if (DEBUG) Log.v(TAG, this + " >>> doInBackground");
    result = AsyncTaskLoader.this.onLoadInBackground();
    if (DEBUG) Log.v(TAG, this + "  <<< doInBackground");
    return result;
    if (DEBUG) Log.v(TAG, this + " onPostExecute");
    try {
      AsyncTaskLoader.this.dispatchOnLoadComplete(this, data);
    } finally {
      done.countDown();
    if (DEBUG) Log.v(TAG, this + " onCancelled");
    try {
      AsyncTaskLoader.this.dispatchOnCancelled(this, result);
    } finally {
      done.countDown();
  public void run() {
    waiting = false;
    AsyncTaskLoader.this.executePendingTask();
protected void onForceLoad() {
  super.onForceLoad();
  cancelLoad();
  mTask = new LoadTask();
  if (DEBUG) Log.v(TAG, "Preparing load: mTask=" + mTask);
  executePendingTask();

代码示例来源:origin: kingargyle/adt-leanback-support

void dispatchOnCancelled(LoadTask task, D data) {
  onCanceled(data);
  if (mCancellingTask == task) {
    if (DEBUG) Log.v(TAG, "Cancelled task is now canceled!");
    rollbackContentChanged();
    mLastLoadCompleteTime = SystemClock.uptimeMillis();
    mCancellingTask = null;
    executePendingTask();
  }
}

代码示例来源:origin: com.google.android/support-v4

void dispatchOnCancelled(LoadTask task, D data) {
  onCanceled(data);
  if (mCancellingTask == task) {
    if (DEBUG) Log.v(TAG, "Cancelled task is now canceled!");
    mLastLoadCompleteTime = SystemClock.uptimeMillis();
    mCancellingTask = null;
    executePendingTask();
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

void dispatchOnLoadComplete(LoadTask task, D data) {
  if (mTask != task) {
    if (DEBUG) Log.v(TAG, "Load complete of old task, trying to cancel");
    dispatchOnCancelled(task, data);
  } else {
    if (isAbandoned()) {
      // This cursor has been abandoned; just cancel the new data.
      onCanceled(data);
    } else {
      commitContentChanged();
      mLastLoadCompleteTime = SystemClock.uptimeMillis();
      mTask = null;
      if (DEBUG) Log.v(TAG, "Delivering result");
      deliverResult(data);
    }
  }
}

代码示例来源:origin: livroandroid/5ed

@Override
public void onCanceled(Bitmap data) {
  super.onCanceled(data);
  Log.d("livroandroid", "loader onCanceled()");
}

代码示例来源:origin: k9mail/k-9

@Override
public void deliverResult(LocalMessage message) {
  this.message = message;
  super.deliverResult(message);
}

代码示例来源:origin: bumptech/glide

@Override
protected void onReset() {
 super.onReset();
 onStopLoading();
 cached = null;
 unregisterContentObserver();
}

代码示例来源:origin: Cleveroad/AdaptiveTableLayout

@Override
protected void onStartLoading() {
  super.onStartLoading();
  if (takeContentChanged()) {
    forceLoad();
  }
}

代码示例来源:origin: QuickBlox/q-municate-android

@Override
public void onCanceled(T objectsList) {
  Log.i(TAG, "+++ onCanceled() called! +++");
  this.objectsList = objectsList;
  // Attempt to cancel the current asynchronous load.
  super.onCanceled(objectsList);
}

代码示例来源:origin: udacity/ud851-Exercises

@Override
  public void deliverResult(String githubJson) {
    mGithubJson = githubJson;
    super.deliverResult(githubJson);
  }
};

代码示例来源:origin: yahoo/squidb

@Override
protected void onReset() {
  super.onReset();
  // Ensure the loader is stopped
  onStopLoading();
  if (cursor != null && !cursor.isClosed()) {
    cursor.close();
  }
  cursor = null;
}

代码示例来源:origin: andforce/iBeebo

@Override
protected void onStartLoading() {
  super.onStartLoading();
  forceLoad();
}

代码示例来源:origin: Cleveroad/MusicBobber

/**
 * Handles a request to cancel a load.
 */
@Override
public void onCanceled(T data) {
  super.onCanceled(data);
  // At this point we can release the resources associated with 'apps'
  // if needed.
  onReleaseResources(data);
}

代码示例来源:origin: udacity/ud851-Exercises

public void deliverResult(Cursor data) {
    mTaskData = data;
    super.deliverResult(data);
  }
};

相关文章