ResourceCursorAdapter

abstract class ResourceCursorAdapter : CursorAdapter
kotlin.Any
   ↳ android.widget.BaseAdapter
   ↳ androidx.cursoradapter.widget.CursorAdapter
   ↳ androidx.cursoradapter.widget.ResourceCursorAdapter

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

Inherited constants
Public constructors
<init>(context: Context!, layout: Int, c: Cursor!)

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. As an alternative, use android.app.LoaderManager with a android.content.CursorLoader.

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

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. As an alternative, use android.app.LoaderManager with a android.content.CursorLoader.

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

Standard constructor.

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

open Unit

Sets the layout resource of the item views.

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

Inflates view(s) from the specified XML file.

open Unit
setDropDownViewResource(dropDownLayout: Int)

Sets the layout resource of the drop down views.

Inherited functions

Public constructors

<init>

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

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. As an alternative, use android.app.LoaderManager with a android.content.CursorLoader.

Constructor the enables auto-requery.

Parameters
context Context!: The context where the ListView associated with this adapter is running
layout Context!: 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.

<init>

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

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. As an alternative, use android.app.LoaderManager with a android.content.CursorLoader.

Constructor with default behavior as per CursorAdapter#CursorAdapter(Context, Cursor, boolean); it is recommended you not use this, but instead #ResourceCursorAdapter(Context, int, Cursor, int). 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 Context!: 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 Context!: The cursor from which to get the data.
autoRequery Context!: 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.

<init>

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 Context!: 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 Context!: The cursor from which to get the data.
flags Context!: Flags used to determine the behavior of the adapter, as per CursorAdapter#CursorAdapter(Context, Cursor, int).

Public methods

newDropDownView

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

setViewResource

open fun setViewResource(layout: Int): Unit

Sets the layout resource of the item views.

Parameters
layout Int: the layout resources used to create item views

newView

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

Inflates view(s) from the specified XML file.

Parameters
context Context!: Interface to application's global information
cursor Context!: The cursor from which to get the data. The cursor is already moved to the correct position.
parent Context!: The parent to which the new view is attached to
Return
View!: the newly created view.

setDropDownViewResource

open 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