Lines Matching refs:Cursor
19 import android.database.Cursor;
25 * Adapter that exposes data from a Cursor to a {@link RecyclerView} widget.
26 * The Cursor must include an Id column or this class will not work.
32 protected Cursor mCursor;
35 public CursorRecyclerViewAdapter(Context context, Cursor cursor) {
37 mCursor = cursor;
45 public Cursor getCursor() {
65 public void onBindViewHolder(VH viewHolder, Cursor cursor) {}
70 throw new IllegalStateException("can't move cursor to position " + position);
76 * Change the underlying cursor to a new cursor. If there is an existing cursor it will
79 * @param cursor The new cursor to be used.
81 public void changeCursor(Cursor cursor) {
82 Cursor old = swapCursor(cursor);
89 * Swap in a new Cursor, returning the old Cursor. Unlike changeCursor(android.database.Cursor),
90 * the returned old Cursor is not closed.
92 * @param newCursor The new cursor to be used.
94 public Cursor swapCursor(Cursor newCursor) {
99 Cursor oldCursor = mCursor;
120 protected int getRowIdColumnIndex(Cursor cursor) {
121 return cursor.getColumnIndex(BaseColumns._ID);