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

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

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

Loader.getId介绍

暂无

代码示例

代码示例来源: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: com.albedinsky.android/database

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

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

/**
 */
@Override
public void onLoadFinished(@NonNull Loader<D> loader, @Nullable D result) {
  final int loaderId = loader.getId();
  if (result != null) onLoadFinished(loaderId, result);
  else onLoadFailed(loaderId);
}

代码示例来源: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;
}

代码示例来源:origin: THEONE10211024/ApiDemos

@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
  mDisplayView.setText("");
  switch (cursorLoader.getId()) {
    case ID_CHANGE_LOADER:
      mChangeAdapter.swapCursor(null);
      break;
    case ID_DELETE_LOADER:
      mDeleteAdapter.swapCursor(null);
      break;
  }
}

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

@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
  mDisplayView.setText("");
  switch (cursorLoader.getId()) {
    case ID_CHANGE_LOADER:
      mChangeAdapter.swapCursor(null);
      break;
    case ID_DELETE_LOADER:
      mDeleteAdapter.swapCursor(null);
      break;
  }
}

代码示例来源:origin: google/ringdroid

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  switch (loader.getId()) {
  case INTERNAL_CURSOR_ID:
    mInternalCursor = data;
    break;
  case EXTERNAL_CURSOR_ID:
    mExternalCursor = data;
    break;
  default:
    return;
  }
  // TODO: should I use a mutex/synchronized block here?
  if (mInternalCursor != null && mExternalCursor != null) {
    Cursor mergeCursor = new MergeCursor(new Cursor[] {mInternalCursor, mExternalCursor});
    mAdapter.swapCursor(mergeCursor);
  }
}

代码示例来源:origin: THEONE10211024/ApiDemos

switch (cursorLoader.getId()) {
  case ID_CHANGE_LOADER:
    mDisplayView.setText(data.getCount() + " change(s) since " + mSearchTime);

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

switch (cursorLoader.getId()) {
  case ID_CHANGE_LOADER:
    mDisplayView.setText(data.getCount() + " change(s) since " + mSearchTime);

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

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  if (!mEnabled) {
    return;
  }
  int loaderId = loader.getId();
  if (loaderId == DIRECTORY_LOADER_ID) {
    mDirectoryListStatus = STATUS_LOADED;
    mAdapter.changeDirectories(data);
    startLoading();
  } else {
    onPartitionLoaded(loaderId, data);
    if (isSearchMode()) {
      int directorySearchMode = getDirectorySearchMode();
      if (directorySearchMode != DirectoryListLoader.SEARCH_MODE_NONE) {
        if (mDirectoryListStatus == STATUS_NOT_LOADED) {
          mDirectoryListStatus = STATUS_LOADING;
          getLoaderManager().initLoader(DIRECTORY_LOADER_ID, null, this);
        } else {
          startLoading();
        }
      }
    } else {
      mDirectoryListStatus = STATUS_NOT_LOADED;
      getLoaderManager().destroyLoader(DIRECTORY_LOADER_ID);
    }
  }
}

相关文章