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

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

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

Loader.onReset介绍

[英]Subclasses must implement this to take care of resetting their loader, as per #reset(). This is not called by clients directly, but as a result of a call to #reset(). This will always be called from the process's main thread.
[中]子类必须实现这一点,以便按照#reset()重置其加载程序。这不是客户端直接调用的,而是调用#reset()的结果。这将始终从进程的主线程调用。

代码示例

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

/**
 * 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
 * {@link #startLoading()} may later be called at which point it must be
 * able to start running again.
 *
 * <p>This updates the Loader's internal state so that
 * {@link #isStarted()} and {@link #isReset()} will return the correct
 * values, and then calls the implementation's {@link #onReset()}.
 *
 * <p>Must be called from the process's main thread.
 */
public void reset() {
  onReset();
  mReset = true;
  mStarted = false;
  mAbandoned = false;
  mContentChanged = false;
}

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

/**
 * 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
 * {@link #startLoading()} may later be called at which point it must be
 * able to start running again.
 *
 * <p>This updates the Loader's internal state so that
 * {@link #isStarted()} and {@link #isReset()} will return the correct
 * values, and then calls the implementation's {@link #onReset()}.
 *
 * <p>Must be called from the process's main thread.
 */
public void reset() {
  onReset();
  mReset = true;
  mStarted = false;
  mAbandoned = false;
  mContentChanged = false;
  mProcessingChange = false;
}

代码示例来源:origin: L4Digital/RxLoader

@Override
protected void onReset() {
  super.onReset();
  onStopLoading();
  mDataCache = null;
  if (mSubscriber != null) {
    mSubscriber.reset();
  }
}

相关文章