android.support.v4.content.AsyncTaskLoader.cancelLoad()方法的使用及代码示例

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

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

AsyncTaskLoader.cancelLoad介绍

[英]Attempt to cancel the current load task. See android.os.AsyncTask#cancel(boolean)for more info. Must be called on the main thread of the process.

Cancelling is not an immediate operation, since the load is performed in a background thread. If there is currently a load in progress, this method requests that the load be cancelled, and notes this is the case; once the background thread has completed its work its remaining state will be cleared. If another load request comes in during this time, it will be held until the cancelled load is complete.
[中]尝试取消当前加载任务。请看android。操作系统。AsyncTask#取消(布尔值)以获取更多信息。必须在进程的主线程上调用。
取消不是立即操作,因为加载是在后台线程中执行的。如果当前有正在进行的加载,此方法请求取消加载,并注意这种情况;后台线程完成其工作后,其剩余状态将被清除。如果在此期间收到另一个加载请求,它将一直保持,直到取消的加载完成。

代码示例

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

@Override
protected void onForceLoad() {
  super.onForceLoad();
  cancelLoad();
  mTask = new LoadTask();
  if (DEBUG) Log.v(TAG, "Preparing load: mTask=" + mTask);
  executePendingTask();
}

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

@Override
protected void onForceLoad() {
  super.onForceLoad();
  cancelLoad();
  mTask = new LoadTask();
  if (DEBUG) Log.v(TAG, "Preparing load: mTask=" + mTask);
  executePendingTask();
}

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

protected void onForceLoad() {
  super.onForceLoad();
  cancelLoad();
  mTask = new LoadTask();
  if (DEBUG) Log.v(TAG, "Preparing load: mTask=" + mTask);

相关文章