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

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

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

Loader.startLoading介绍

[英]Starts an asynchronous load of the Loader's data. When the result is ready the callbacks will be called on the process's main thread. If a previous load has been completed and is still valid the result may be passed to the callbacks immediately. The loader will monitor the source of the data set and may deliver future callbacks if the source changes. Calling #stopLoading will stop the delivery of callbacks.

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

Must be called from the process's main thread.
[中]启动加载程序数据的异步加载。当结果就绪时,将在进程的主线程上调用回调。如果以前的加载已经完成并且仍然有效,那么结果可能会立即传递给回调。加载程序将监视数据集的源,如果源发生更改,加载程序可能会在将来进行回调。调用#stopLoading将停止回调的传递。
这将更新加载程序的内部状态,以便#isStarted()和#isReset()将返回正确的值,然后调用实现的#onStartLoading()。
必须从进程的主线程调用。

代码示例

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

@Override
  public void handleMessage(Message msg) {
    loader.registerListener(0, listener);
    loader.startLoading();
  }
};

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

mListenerRegistered = true;
mLoader.startLoading();

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

mListenerRegistered = true;
mLoader.startLoading();

相关文章