ResourceCursorAdapter

abstract class ResourceCursorAdapter : CursorAdapter

Known direct subclasses
SimpleCursorAdapter

Static library support version of the framework's android.widget.SimpleCursorAdapter.


Static library support version of the framework's android.widget.ResourceCursorAdapter. 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

Public constructors

ResourceCursorAdapter(context: Context!, layout: Int, c: Cursor!)

This function is deprecated.

This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors.

ResourceCursorAdapter(
    context: Context!,
    layout: Int,
    c: Cursor!,
    autoRequery: Boolean
)

This function is deprecated.

This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors.

ResourceCursorAdapter(context: Context!, layout: Int, c: Cursor!, flags: Int)

Standard constructor.

Public functions

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

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

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

Inflates view(s) from the specified XML file.

Unit
setDropDownViewResource(dropDownLayout: Int)

Sets the layout resource of the drop down views.

Unit

Sets the layout resource of the item views.

Inherited Constants

From android.widget.Adapter
const Int
const Int
NO_SELECTION = -2147483648
From androidx.cursoradapter.widget.CursorAdapter
const Int

This property is deprecated.

This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors.

const Int

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

Inherited functions

From android.widget.Adapter
abstract Int
abstract Any!
abstract Long
abstract View!
getView(p: Int, p1: View!, p2: ViewGroup!)
From android.widget.BaseAdapter
From androidx.cursoradapter.widget.CursorAdapter
abstract Unit
bindView(view: View!, context: Context!, cursor: Cursor!)

Bind an existing view to the data pointed to by cursor

Unit
changeCursor(cursor: Cursor!)

Change the underlying cursor to a new cursor.

CharSequence!

Converts the cursor into a CharSequence.

Int
Cursor!

Returns the cursor.

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

Returns the query filter provider used for filtering.

Any!
getItem(position: Int)
Long
getItemId(position: Int)
View!
getView(position: Int, convertView: View!, parent: ViewGroup!)
Boolean
Unit
init(context: Context!, c: Cursor!, autoRequery: Boolean)

This function is deprecated.

Don't use this, use the normal constructor.

Unit

Called when the ContentObserver on the cursor receives a change notification.

Cursor!

Runs a query with the specified constraint.

Unit

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

Cursor!
swapCursor(newCursor: Cursor!)

Swap in a new Cursor, returning the old Cursor.

From android.widget.Filterable
abstract Filter!

Public constructors

ResourceCursorAdapter

Added in 1.0.0
Deprecated in 1.0.0
ResourceCursorAdapter(context: Context!, layout: Int, c: Cursor!)

Constructor the enables auto-requery.

Parameters
context: Context!

The context where the ListView associated with this adapter is running

layout: Int

resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views.

ResourceCursorAdapter

Added in 1.0.0
Deprecated in 1.0.0
ResourceCursorAdapter(
    context: Context!,
    layout: Int,
    c: Cursor!,
    autoRequery: Boolean
)

Constructor with default behavior as per CursorAdapter; it is recommended you not use this, but instead ResourceCursorAdapter. When using this constructor, FLAG_REGISTER_CONTENT_OBSERVER will always be set.

Parameters
context: Context!

The context where the ListView associated with this adapter is running

layout: Int

resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views.

c: Cursor!

The cursor from which to get the data.

autoRequery: Boolean

If true the adapter will call requery() on the cursor whenever it changes so the most recent data is always displayed. Using true here is discouraged.

ResourceCursorAdapter

Added in 1.0.0
ResourceCursorAdapter(context: Context!, layout: Int, c: Cursor!, flags: Int)

Standard constructor.

Parameters
context: Context!

The context where the ListView associated with this adapter is running

layout: Int

Resource identifier of a layout file that defines the views for this list item. Unless you override them later, this will define both the item views and the drop down views.

c: Cursor!

The cursor from which to get the data.

flags: Int

Flags used to determine the behavior of the adapter, as per CursorAdapter.

Public functions

newDropDownView

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

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

Parameters
context: Context!

Interface to application's global information

cursor: Cursor!

The cursor from which to get the data. The cursor is already moved to the correct position.

parent: ViewGroup!

The parent to which the new view is attached to

Returns
View!

the newly created view.

newView

Added in 1.1.0-alpha01
fun newView(context: Context!, cursor: Cursor!, parent: ViewGroup!): View!

Inflates view(s) from the specified XML file.

See also
newView

setDropDownViewResource

Added in 1.0.0
fun setDropDownViewResource(dropDownLayout: Int): Unit

Sets the layout resource of the drop down views.

Parameters
dropDownLayout: Int

the layout resources used to create drop down views

setViewResource

Added in 1.0.0
fun setViewResource(layout: Int): Unit

Sets the layout resource of the item views.

Parameters
layout: Int

the layout resources used to create item views