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

x33g5p2x  于2022-01-24 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(141)

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

Loader.reset介绍

[英]Resets the state of the Loader. The Loader should at this point free all of its resources, since it may never be called again; however, its #startLoading() may later be called at which point it must be able to start running again.

This updates the Loader's internal state so that #isStarted() and #isReset() will return the correct values, and then calls the implementation's #onReset().

Must be called from the process's main thread.
[中]重置加载程序的状态。此时加载程序应该释放所有资源,因为它可能永远不会被调用;但是,稍后可能会调用它的#starting load(),此时它必须能够再次开始运行。
这将更新加载程序的内部状态,以便#isStart()和#isReset()将返回正确的值,然后调用实现的#onReset()。
必须从进程的主线程调用。

代码示例

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

@Override
  public void onCancel(DialogInterface dialog) {
    Log.d("livroandroid", "onCancel()");
    // Cancela o loader
    getLoaderManager().getLoader(0).reset();
  }
});

代码示例来源:origin: com.uphyca/android-junit3-extension-support-v4

@Override
  public void onLoadComplete(Loader<T> completedLoader, T data) {
    // Shut the loader down
    completedLoader.unregisterListener(this);
    completedLoader.stopLoading();
    completedLoader.reset();
    // Store the result, unblocking the test thread
    queue.add(data);
  }
};

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

mLoader.unregisterListener(this);
mLoader.reset();

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

mLoader.unregisterListener(this);
mLoader.reset();

相关文章