android.widget.SimpleCursorAdapter.swapCursor()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(123)

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

SimpleCursorAdapter.swapCursor介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Test
public void testSwapCursorToNull() {
 SimpleCursorAdapter adapter =
   new SimpleCursorAdapter(context, 1, null, new String[] {"name"}, new int[] {2}, 0);
 Cursor cursor = setUpDatabase();
 adapter.swapCursor(cursor);
 adapter.swapCursor(null);
 assertThat(adapter.getCursor()).isNull();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testSwapCursor() {
 SimpleCursorAdapter adapter =
   new SimpleCursorAdapter(context, 1, null, new String[] {"name"}, new int[] {2}, 0);
 Cursor cursor = setUpDatabase();
 adapter.swapCursor(cursor);
 assertThat(adapter.getCursor()).isSameAs(cursor);
}

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

@Override
  public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to onLoadFinished()
    // above is about to be closed.  We need to make sure we are no
    // longer using it.
    mAdapter.swapCursor(null);
  }
}

代码示例来源:origin: vogellacompany/codeexamples-android

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  adapter.swapCursor(data);
}

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

public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to onLoadFinished()
    // above is about to be closed.  We need to make sure we are no
    // longer using it.
    mAdapter.swapCursor(null);
  }
}

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

@Override
  public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to onLoadFinished()
    // above is about to be closed.  We need to make sure we are no
    // longer using it.
    mAdapter.swapCursor(null);
  }
}

代码示例来源:origin: vogellacompany/codeexamples-android

@Override
public void onLoaderReset(Loader<Cursor> loader) {
  // data is not available anymore, delete reference
  adapter.swapCursor(null);
}

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

public void onLoaderReset(Loader<Cursor> loader) {
    mAdapter.swapCursor(null);
  }
}

代码示例来源:origin: openbmap/radiocells-scanner-android

@Override
public final void onLoaderReset(final Loader<Cursor> arg0) {
  mAdapter.swapCursor(null);
}

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

public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to onLoadFinished()
    // above is about to be closed.  We need to make sure we are no
    // longer using it.
    mAdapter.swapCursor(null);
  }
}

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

public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to onLoadFinished()
    // above is about to be closed.  We need to make sure we are no
    // longer using it.
    mAdapter.swapCursor(null);
  }
}

代码示例来源:origin: BoBoMEe/Android-Demos

@Override public void onLoaderReset(Loader<Cursor> loader) {
  // data is not available anymore, delete reference
  adapter.swapCursor(null);
 }
}

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

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  Log.v("Ringdroid", data.getCount() + " contacts");
  mAdapter.swapCursor(data);
}

代码示例来源:origin: demantz/RFAnalyzer

public void reloadCategories() {
  if(categoriesCursor != null)
    categoriesCursor.close();
  categoriesCursor = activity.getContentResolver().query(BookmarkCategories.CONTENT_URI, null, null, new String[] {}, null);
  categoriesAdapter.swapCursor(categoriesCursor);
}

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

@Override
public void onLoadFinished(android.content.Loader<Cursor> loader, Cursor cursor) {
  Log.d(TAG, "onLoadFinished: " + Arrays.toString(cursor.getColumnNames()));
  mAdapter.swapCursor(cursor);
}

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

public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  // Swap the new cursor in.  (The framework will take care of closing the
  // old cursor once we return.)
  mAdapter.swapCursor(data);
  // The list should now be shown.
  if (isResumed()) {
    setListShown(true);
  } else {
    setListShownNoAnimation(true);
  }
}

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

public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  // Swap the new cursor in.  (The framework will take care of closing the
  // old cursor once we return.)
  mAdapter.swapCursor(data);
  // The list should now be shown.
  if (isResumed()) {
    setListShown(true);
  } else {
    setListShownNoAnimation(true);
  }
}

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

public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  mAdapter.swapCursor(data);
  // The list should now be shown.
  if (isResumed()) {
    setListShown(true);
  } else {
    setListShownNoAnimation(true);
  }
}

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

public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  // Swap the new cursor in.  (The framework will take care of closing the
  // old cursor once we return.)
  mAdapter.swapCursor(data);
  // The list should now be shown.
  if (isResumed()) {
    setListShown(true);
  } else {
    setListShownNoAnimation(true);
  }
}

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

public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
  // Swap the new cursor in.  (The framework will take care of closing the
  // old cursor once we return.)
  mAdapter.swapCursor(data);
  // The list should now be shown.
  if (isResumed()) {
    setListShown(true);
  } else {
    setListShownNoAnimation(true);
  }
}

相关文章