@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(); }
@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); }
@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); } }
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { adapter.swapCursor(data); }
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); } }
@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); } }
@Override public void onLoaderReset(Loader<Cursor> loader) { // data is not available anymore, delete reference adapter.swapCursor(null); }
public void onLoaderReset(Loader<Cursor> loader) { mAdapter.swapCursor(null); } }
@Override public final void onLoaderReset(final Loader<Cursor> arg0) { mAdapter.swapCursor(null); }
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); } }
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); } }
@Override public void onLoaderReset(Loader<Cursor> loader) { // data is not available anymore, delete reference adapter.swapCursor(null); } }
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { Log.v("Ringdroid", data.getCount() + " contacts"); mAdapter.swapCursor(data); }
public void reloadCategories() { if(categoriesCursor != null) categoriesCursor.close(); categoriesCursor = activity.getContentResolver().query(BookmarkCategories.CONTENT_URI, null, null, new String[] {}, null); categoriesAdapter.swapCursor(categoriesCursor); }
@Override public void onLoadFinished(android.content.Loader<Cursor> loader, Cursor cursor) { Log.d(TAG, "onLoadFinished: " + Arrays.toString(cursor.getColumnNames())); mAdapter.swapCursor(cursor); }
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); } }
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); } }
public void onLoadFinished(Loader<Cursor> loader, Cursor data) { mAdapter.swapCursor(data); // The list should now be shown. if (isResumed()) { setListShown(true); } else { setListShownNoAnimation(true); } }
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); } }
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); } }