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

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(181)

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

AsyncTaskLoader介绍

暂无

代码示例

代码示例来源: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: square/assertj-android

@TargetApi(JELLY_BEAN)
public AsyncTaskLoaderAssert hasLoadInBackgroundCancelled() {
 isNotNull();
 assertThat(actual.isLoadInBackgroundCanceled()) //
   .overridingErrorMessage("Expected load in background cancelled but was not cancelled.") //
   .isTrue();
 return this;
}

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

@Override
public void deliverResult(SquidCursor<T> data) {
  if (isReset()) {
    if (data != null) {
      data.close();
    }
    return;
  }
  SquidCursor<T> oldCursor = this.cursor;
  this.cursor = data;
  if (isStarted()) {
    super.deliverResult(data);
  }
  if (oldCursor != null && oldCursor != data && !oldCursor.isClosed()) {
    oldCursor.close();
  }
}

代码示例来源:origin: gearvrf/GearVRf-Demos

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

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

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

代码示例来源:origin: vbier/habpanelviewer

@Override
public void deliverResult(List<String> data) {
  mData = data;
  super.deliverResult(data);
}

代码示例来源:origin: ashishbhandari/RetailStore

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

代码示例来源:origin: rciovati/retrofit-loaders-example

@Override
protected void onStartLoading() {
  super.onStartLoading();
  if (mCachedResponse != null) {
    deliverResult(mCachedResponse);
  }
  if (takeContentChanged() || mCachedResponse == null) {
    forceLoad();
  }
}

代码示例来源:origin: dicodingacademy/a14-made-labs1

@Override
public void deliverResult(final ArrayList<WeatherItems> data) {
  mData = data;
  mHasResult = true;
  super.deliverResult(data);
}

代码示例来源:origin: rciovati/retrofit-loaders-example

@Override
protected void onReset() {
  super.onReset();
  mCachedResponse = null;
}

代码示例来源:origin: AndroidHardening/PdfViewer

@Override
public void onCanceled(List<CharSequence> properties) {
  super.onCanceled(properties);
  onReleaseResources();
}

代码示例来源:origin: square/assertj-android

@TargetApi(JELLY_BEAN)
 public AsyncTaskLoaderAssert hasLoadInBackgroundNotCancelled() {
  isNotNull();
  assertThat(actual.isLoadInBackgroundCanceled()) //
    .overridingErrorMessage("Expected load in background not cancelled but was cancelled.") //
    .isFalse();
  return this;
 }
}

代码示例来源:origin: jclehner/rxdroid

@Override
public void deliverResult(List<? extends ItemHolder<T>> data)
{
  mData = data;
  if(isStarted())
    super.deliverResult(data);
}

代码示例来源:origin: geniusgithub/AndroidDialer

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

代码示例来源:origin: qiubiteme/android_api_demos

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

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(JELLY_BEAN)
public AsyncTaskLoaderAssert hasLoadInBackgroundCancelled() {
 isNotNull();
 assertThat(actual.isLoadInBackgroundCanceled()) //
   .overridingErrorMessage("Expected load in background cancelled but was not cancelled.") //
   .isTrue();
 return this;
}

代码示例来源:origin: com.codeslap/groundy

@Override
public void deliverResult(List<T> list) {
  if (isReset()) {
    // An async query came in while the loader is stopped
    if (list != null) {
      list.clear();
    }
    return;
  }
  List<T> oldList = mList;
  mList = list;
  if (isStarted()) {
    super.deliverResult(list);
  }
  if (oldList != null && oldList != list && oldList.size() > 0) {
    oldList.clear();
  }
}

代码示例来源:origin: com.codeslap/groundy

@Override
protected void onReset() {
  super.onReset();
  // Ensure the loader is stopped
  onStopLoading();
  if (mList != null && mList.size() > 0) {
    mList.clear();
  }
  mList = null;
}

代码示例来源:origin: li2/learning-android-open-source

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

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(JELLY_BEAN)
 public AsyncTaskLoaderAssert hasLoadInBackgroundNotCancelled() {
  isNotNull();
  assertThat(actual.isLoadInBackgroundCanceled()) //
    .overridingErrorMessage("Expected load in background not cancelled but was cancelled.") //
    .isFalse();
  return this;
 }
}

相关文章