Android 12 Developer Preview is here! Try it out, and give us your feedback!

CursorAdapter

abstract class CursorAdapter : BaseAdapter, Filterable, CursorFilterClient
kotlin.Any
   ↳ android.widget.BaseAdapter
   ↳ androidx.cursoradapter.widget.CursorAdapter

Static library support version of the framework's android.widget.CursorAdapter. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Summary

Constants
static Int

If set the adapter will call requery() on the cursor whenever a content change notification is delivered.

static Int

If set the adapter will register a content observer on the cursor and will call onContentChanged() when a notification comes in.

Public constructors
<init>(context: Context!, c: Cursor!)

Constructor that always enables auto-requery.

<init>(context: Context!, c: Cursor!, autoRequery: Boolean)

Constructor that allows control over auto-requery.

<init>(context: Context!, c: Cursor!, flags: Int)

Recommended constructor.

Public methods
abstract Unit
bindView(view: View!, context: Context!, cursor: Cursor!)

Bind an existing view to the data pointed to by cursor

open Unit
changeCursor(cursor: Cursor!)

Change the underlying cursor to a new cursor.

open CharSequence!

Converts the cursor into a CharSequence.

open Int

open Cursor!

Returns the cursor.

open View!
getDropDownView(position: Int, convertView: View!, parent: ViewGroup!)

open Filter!

open FilterQueryProvider!

Returns the query filter provider used for filtering.

open Any!
getItem(position: Int)

open Long
getItemId(position: Int)

open View!
getView(position: Int, convertView: View!, parent: ViewGroup!)

open Boolean

open View!
newDropDownView(context: Context!, cursor: Cursor!, parent: ViewGroup!)

Makes a new drop down view to hold the data pointed to by cursor.

abstract View!
newView(context: Context!, cursor: Cursor!, parent: ViewGroup!)

Makes a new view to hold the data pointed to by cursor.

open Cursor!

Runs a query with the specified constraint.

open Unit

Sets the query filter provider used to filter the current Cursor.

open Cursor!