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

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

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

Loader介绍

暂无

代码示例

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

public S hasId(int id) {
 isNotNull();
 int actualId = actual.getId();
 assertThat(actualId) //
   .overridingErrorMessage("Expected ID <%s> but was <%s>.", id, actualId) //
   .isEqualTo(id);
 return myself;
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
public void deliverResult(GraphObjectCursor cursor) {
  GraphObjectCursor oldCursor = this.cursor;
  this.cursor = cursor;
  if (isStarted()) {
    super.deliverResult(cursor);
    if (oldCursor != null && oldCursor != cursor && !oldCursor.isClosed()) {
      oldCursor.close();
    }
  }
}

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

public S isAbandoned() {
 isNotNull();
 assertThat(actual.isAbandoned()) //
   .overridingErrorMessage("Expected to be abandoned but was not abandoned.") //
   .isTrue();
 return myself;
}

代码示例来源:origin: ardovic/Open-Source-Android-Weather-App

@Override
  public Cursor runQuery(CharSequence constraint) {
    if (constraint != null) {
      if (constraint.length() >= 3 && !TextUtils.isEmpty(constraint)) {
        Bundle bundle = new Bundle();
        String query = charArrayUpperCaser(constraint);
        bundle.putString(CITY_ARGS, query);
        getLoaderManager().restartLoader(0, bundle, MainActivity.this).forceLoad();
      }
    }
    return null;
  }
});

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

public S isNotReset() {
 isNotNull();
 assertThat(actual.isReset()) //
   .overridingErrorMessage("Expected to not be reset but was reset.") //
   .isFalse();
 return myself;
}

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

public S isNotStarted() {
  isNotNull();
  assertThat(actual.isStarted()) //
    .overridingErrorMessage("Expected to not be started but was started.") //
    .isFalse();
  return myself;
 }
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
protected void onStartLoading() {
  super.onStartLoading();
  if (cursor != null) {
    deliverResult(cursor);
  }
}

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

@Override
protected void onForceLoad() {
  super.onForceLoad();
  dispose();
  subscribe();
}

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

private void refresh() {
  getLoaderManager().getLoader(LOADER_ID).forceLoad();
}

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

public S isReset() {
 isNotNull();
 assertThat(actual.isReset()) //
   .overridingErrorMessage("Expected to be reset but was not reset.") //
   .isTrue();
 return myself;
}

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

public S isStarted() {
 isNotNull();
 assertThat(actual.isStarted()) //
   .overridingErrorMessage("Expected to be started but was not started.") //
   .isTrue();
 return myself;
}

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

@Override
protected void onStartLoading() {
  super.onStartLoading();
  if (mDataCache != null) {
    // send cached data immediately
    deliverResult(mDataCache);
  }
  if (takeContentChanged() || mDataCache == null) {
    forceLoad();
  } else {
    subscribe();
  }
}

代码示例来源:origin: gigabytedevelopers/FireFiles

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

代码示例来源:origin: com.albedinsky.android/database

/**
 */
@Override
public final void onLoaderReset(@NonNull Loader<D> loader) {
  onLoaderReset(loader.getId());
}

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

@Override
public void onResume() {
  Trace.beginSection(TAG + " onResume");
  super.onResume();
  if (mContactTileAdapter != null) {
    mContactTileAdapter.refreshContactsPreferences();
  }
  if (PermissionsUtil.hasContactsPermissions(getActivity())) {
    if (getLoaderManager().getLoader(LOADER_ID_CONTACT_TILE) == null) {
      getLoaderManager().initLoader(LOADER_ID_CONTACT_TILE, null,
          mContactTileLoaderListener);
    } else {
      getLoaderManager().getLoader(LOADER_ID_CONTACT_TILE).forceLoad();
    }
    mEmptyView.setDescription(R.string.speed_dial_empty);
    mEmptyView.setActionLabel(R.string.speed_dial_empty_add_favorite_action);
  } else {
    mEmptyView.setDescription(R.string.permission_no_speeddial);
    mEmptyView.setActionLabel(R.string.permission_single_turn_on);
  }
  Trace.endSection();
}

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

public S isReset() {
 isNotNull();
 assertThat(actual.isReset()) //
   .overridingErrorMessage("Expected to be reset but was not reset.") //
   .isTrue();
 return myself;
}

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

public S isNotStarted() {
  isNotNull();
  assertThat(actual.isStarted()) //
    .overridingErrorMessage("Expected to not be started but was started.") //
    .isFalse();
  return myself;
 }
}

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

public S isNotAbandoned() {
 isNotNull();
 assertThat(actual.isAbandoned()) //
   .overridingErrorMessage("Expected to not be abandoned but was abandoned.") //
   .isFalse();
 return myself;
}

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

@Override
public void deliverResult(T data) {
  if (data != null) {
    mDataCache = data;
  }
  if (isStarted()) {
    super.deliverResult(data);
  }
}

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

public S hasId(int id) {
 isNotNull();
 int actualId = actual.getId();
 assertThat(actualId) //
   .overridingErrorMessage("Expected ID <%s> but was <%s>.", id, actualId) //
   .isEqualTo(id);
 return myself;
}

相关文章