# SimpleCursorAdapter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#nestedclasses)\|[Inherited Constants](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#inhconstants)\|[Ctors](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#pubctors)\|[Methods](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#inhmethods)  

# SimpleCursorAdapter

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/widget/SimpleCursorAdapter "View this page in Kotlin")\|Java

`
public


class
SimpleCursorAdapter
`  
`


``


``


``

extends `[ResourceCursorAdapter](https://developer.android.com/reference/android/widget/ResourceCursorAdapter)`


``


`

|---|---|---|---|------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||||
| ↳ | [android.widget.BaseAdapter](https://developer.android.com/reference/android/widget/BaseAdapter) ||||
|   | ↳ | [android.widget.CursorAdapter](https://developer.android.com/reference/android/widget/CursorAdapter) |||
|   |   | ↳ | [android.widget.ResourceCursorAdapter](https://developer.android.com/reference/android/widget/ResourceCursorAdapter) ||
|   |   |   | ↳ | android.widget.SimpleCursorAdapter |

<br />

*** ** * ** ***

An easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file. You can specify which columns you want, which views you want to display the columns, and the XML file that defines the appearance of these views. Binding occurs in two phases. First, if a[SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)is available,[ViewBinder.setViewValue(android.view.View, android.database.Cursor, int)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder#setViewValue(android.view.View,%20android.database.Cursor,%20int))is invoked. If the returned value is true, binding has occured. If the returned value is false and the view to bind is a TextView,[setViewText(android.widget.TextView, java.lang.String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewText(android.widget.TextView,%20java.lang.String))is invoked. If the returned value is false and the view to bind is an ImageView,[setViewImage(android.widget.ImageView, java.lang.String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewImage(android.widget.ImageView,%20java.lang.String))is invoked. If no appropriate binding can be found, an[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)is thrown. If this adapter is used with filtering, for instance in an[AutoCompleteTextView](https://developer.android.com/reference/android/widget/AutoCompleteTextView), you can use the[SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter)and the[FilterQueryProvider](https://developer.android.com/reference/android/widget/FilterQueryProvider)interfaces to get control over the filtering process. You can refer to[convertToString(android.database.Cursor)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#convertToString(android.database.Cursor))and[CursorAdapter.runQueryOnBackgroundThread(java.lang.CharSequence)](https://developer.android.com/reference/android/widget/CursorAdapter#runQueryOnBackgroundThread(java.lang.CharSequence))for more information.

## Summary

|                                                                                                                                     ### Nested classes                                                                                                                                      ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter) This class can be used by external clients of SimpleCursorAdapter to define how the Cursor should be converted to a String. |
| ` interface` | [SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder) This class can be used by external clients of SimpleCursorAdapter to bind values fom the Cursor to views.                                             |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.widget.CursorAdapter](https://developer.android.com/reference/android/widget/CursorAdapter) |-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [FLAG_AUTO_REQUERY](https://developer.android.com/reference/android/widget/CursorAdapter#FLAG_AUTO_REQUERY) *This constant was deprecated in API level 15. 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[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager)with a[CursorLoader](https://developer.android.com/reference/android/content/CursorLoader).* | | `int` | [FLAG_REGISTER_CONTENT_OBSERVER](https://developer.android.com/reference/android/widget/CursorAdapter#FLAG_REGISTER_CONTENT_OBSERVER) If set the adapter will register a content observer on the cursor and will call[onContentChanged()](https://developer.android.com/reference/android/widget/CursorAdapter#onContentChanged())when a notification comes in.                                                                                                                                                                                              | |
| From interface[android.widget.Adapter](https://developer.android.com/reference/android/widget/Adapter) |-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [IGNORE_ITEM_VIEW_TYPE](https://developer.android.com/reference/android/widget/Adapter#IGNORE_ITEM_VIEW_TYPE) An item view type that causes the[AdapterView](https://developer.android.com/reference/android/widget/AdapterView)to ignore the item view. | | `int` | [NO_SELECTION](https://developer.android.com/reference/android/widget/Adapter#NO_SELECTION) <br />                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[SimpleCursorAdapter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#SimpleCursorAdapter(android.content.Context,%20int,%20android.database.Cursor,%20java.lang.String[],%20int[]))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, int layout, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` c, `[String[]](https://developer.android.com/reference/java/lang/String)` from, int[] to) ` *This constructor 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. As an alternative, use[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager)with a[CursorLoader](https://developer.android.com/reference/android/content/CursorLoader).* |
| ` `[SimpleCursorAdapter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#SimpleCursorAdapter(android.content.Context,%20int,%20android.database.Cursor,%20java.lang.String[],%20int[],%20int))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, int layout, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` c, `[String[]](https://developer.android.com/reference/java/lang/String)` from, int[] to, int flags) ` Standard constructor.                                                                                                                                                                                                                                                                                                                                                                                            |

|                                                                                                                                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                                                                                                                                   ||
|------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                                                              | ` `[bindView](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#bindView(android.view.View,%20android.content.Context,%20android.database.Cursor))`(`[View](https://developer.android.com/reference/android/view/View)` view, `[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor) ` Binds all of the field names passed into the "to" parameter of the constructor with their corresponding cursor columns as specified in the "from" parameter. |
| ` void`                                                                                                                                              | ` `[changeCursorAndColumns](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#changeCursorAndColumns(android.database.Cursor,%20java.lang.String[],%20int[]))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` c, `[String[]](https://developer.android.com/reference/java/lang/String)` from, int[] to) ` Change the cursor and change the column-to-view mappings at the same time.                                                                                                                                                      |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                                                    | ` `[convertToString](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#convertToString(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor) ` Returns a CharSequence representation of the specified Cursor as defined by the current CursorToStringConverter.                                                                                                                                                                                                                                               |
| ` `[SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter) | ` `[getCursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getCursorToStringConverter())`() ` Returns the converter used to convert the filtering Cursor into a String.                                                                                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                                                               | ` `[getStringConversionColumn](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getStringConversionColumn())`() ` Return the index of the column used to get a String representation of the Cursor.                                                                                                                                                                                                                                                                                                                                                                   |
| ` `[SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)                           | ` `[getViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getViewBinder())`() ` Returns the[ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)used to bind data to views.                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                                                              | ` `[setCursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter))`(`[SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter)` cursorToStringConverter) ` Sets the converter used to convert the filtering Cursor into a String.                                                                                                                                       |
| ` void`                                                                                                                                              | ` `[setStringConversionColumn](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setStringConversionColumn(int))`(int stringConversionColumn) ` Defines the index of the column in the Cursor used to get a String representation of that Cursor.                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                                                              | ` `[setViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder))`(`[SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)` viewBinder) ` Sets the binder used to bind data to views.                                                                                                                                                                                                                                                |
| ` void`                                                                                                                                              | ` `[setViewImage](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewImage(android.widget.ImageView,%20java.lang.String))`(`[ImageView](https://developer.android.com/reference/android/widget/ImageView)` v, `[String](https://developer.android.com/reference/java/lang/String)` value) ` Called by bindView() to set the image for an ImageView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to an ImageView.                                                                                              |
| ` void`                                                                                                                                              | ` `[setViewText](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewText(android.widget.TextView,%20java.lang.String))`(`[TextView](https://developer.android.com/reference/android/widget/TextView)` v, `[String](https://developer.android.com/reference/java/lang/String)` text) ` Called by bindView() to set the text for a TextView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to a TextView.                                                                                                         |
| ` `[Cursor](https://developer.android.com/reference/android/database/Cursor)                                                                         | ` `[swapCursor](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#swapCursor(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` c) ` Swap in a new Cursor, returning the old Cursor.                                                                                                                                                                                                                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.widget.ResourceCursorAdapter](https://developer.android.com/reference/android/widget/ResourceCursorAdapter)` ` |----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[View](https://developer.android.com/reference/android/view/View) | ` `[newDropDownView](https://developer.android.com/reference/android/widget/ResourceCursorAdapter#newDropDownView(android.content.Context,%20android.database.Cursor,%20android.view.ViewGroup))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Makes a new drop down view to hold the data pointed to by cursor. | | ` `[View](https://developer.android.com/reference/android/view/View) | ` `[newView](https://developer.android.com/reference/android/widget/ResourceCursorAdapter#newView(android.content.Context,%20android.database.Cursor,%20android.view.ViewGroup))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Inflates view(s) from the specified XML file.                                     | | ` void`                                                              | ` `[setDropDownViewResource](https://developer.android.com/reference/android/widget/ResourceCursorAdapter#setDropDownViewResource(int))`(int dropDownLayout) ` <br /> Sets the layout resource of the drop down views.                                                                                                                                                                                                                                                                                                                | | ` void`                                                              | ` `[setDropDownViewTheme](https://developer.android.com/reference/android/widget/ResourceCursorAdapter#setDropDownViewTheme(android.content.res.Resources.Theme))`(`[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)` theme) ` Sets the[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)against which drop-down views are inflated.                                                                                                        | | ` void`                                                              | ` `[setViewResource](https://developer.android.com/reference/android/widget/ResourceCursorAdapter#setViewResource(int))`(int layout) ` <br /> Sets the layout resource of the item views.                                                                                                                                                                                                                                                                                                                                             | ||
| From class` `[android.widget.CursorAdapter](https://developer.android.com/reference/android/widget/CursorAdapter)` ` |------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`                                                                                     | ` `[bindView](https://developer.android.com/reference/android/widget/CursorAdapter#bindView(android.view.View,%20android.content.Context,%20android.database.Cursor))`(`[View](https://developer.android.com/reference/android/view/View)` view, `[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor) ` Bind an existing view to the data pointed to by cursor                                           | | ` void`                                                                                              | ` `[changeCursor](https://developer.android.com/reference/android/widget/CursorAdapter#changeCursor(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor) ` Change the underlying cursor to a new cursor.                                                                                                                                                                                                                                                            | | ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                    | ` `[convertToString](https://developer.android.com/reference/android/widget/CursorAdapter#convertToString(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor) ` <br /> Converts the cursor into a CharSequence.                                                                                                                                                                                                                                                    | | ` int`                                                                                               | ` `[getCount](https://developer.android.com/reference/android/widget/CursorAdapter#getCount())`() ` How many items are in the data set represented by this Adapter.                                                                                                                                                                                                                                                                                                                                                           | | ` `[Cursor](https://developer.android.com/reference/android/database/Cursor)                         | ` `[getCursor](https://developer.android.com/reference/android/widget/CursorAdapter#getCursor())`() ` Returns the cursor.                                                                                                                                                                                                                                                                                                                                                                                                     | | ` `[View](https://developer.android.com/reference/android/view/View)                                 | ` `[getDropDownView](https://developer.android.com/reference/android/widget/CursorAdapter#getDropDownView(int,%20android.view.View,%20android.view.ViewGroup))`(int position, `[View](https://developer.android.com/reference/android/view/View)` convertView, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Gets a[View](https://developer.android.com/reference/android/view/View)that displays in the drop down popup the data at the specified position in the data set.        | | ` `[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)    | ` `[getDropDownViewTheme](https://developer.android.com/reference/android/widget/CursorAdapter#getDropDownViewTheme())`() ` Returns the value previously set by a call to[setDropDownViewTheme(android.content.res.Resources.Theme)](https://developer.android.com/reference/android/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)).                                                                                                                                                  | | ` `[Filter](https://developer.android.com/reference/android/widget/Filter)                           | ` `[getFilter](https://developer.android.com/reference/android/widget/CursorAdapter#getFilter())`() ` <br /> Returns a filter that can be used to constrain data with a filtering pattern.                                                                                                                                                                                                                                                                                                                                    | | ` `[FilterQueryProvider](https://developer.android.com/reference/android/widget/FilterQueryProvider) | ` `[getFilterQueryProvider](https://developer.android.com/reference/android/widget/CursorAdapter#getFilterQueryProvider())`() ` Returns the query filter provider used for filtering.                                                                                                                                                                                                                                                                                                                                         | | ` `[Object](https://developer.android.com/reference/java/lang/Object)                                | ` `[getItem](https://developer.android.com/reference/android/widget/CursorAdapter#getItem(int))`(int position) ` Get the data item associated with the specified position in the data set.                                                                                                                                                                                                                                                                                                                                    | | ` long`                                                                                              | ` `[getItemId](https://developer.android.com/reference/android/widget/CursorAdapter#getItemId(int))`(int position) ` Get the row id associated with the specified position in the list.                                                                                                                                                                                                                                                                                                                                       | | ` `[View](https://developer.android.com/reference/android/view/View)                                 | ` `[getView](https://developer.android.com/reference/android/widget/CursorAdapter#getView(int,%20android.view.View,%20android.view.ViewGroup))`(int position, `[View](https://developer.android.com/reference/android/view/View)` convertView, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Get a View that displays the data at the specified position in the data set.                                                                                                           | | ` boolean`                                                                                           | ` `[hasStableIds](https://developer.android.com/reference/android/widget/CursorAdapter#hasStableIds())`() ` Indicates whether the item ids are stable across changes to the underlying data.                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                              | ` `[init](https://developer.android.com/reference/android/widget/CursorAdapter#init(android.content.Context,%20android.database.Cursor,%20boolean))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` c, boolean autoRequery) ` *This method was deprecated in API level 15. Don't use this, use the normal constructor. This will be removed in the future.*                                                | | ` `[View](https://developer.android.com/reference/android/view/View)                                 | ` `[newDropDownView](https://developer.android.com/reference/android/widget/CursorAdapter#newDropDownView(android.content.Context,%20android.database.Cursor,%20android.view.ViewGroup))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Makes a new drop down view to hold the data pointed to by cursor. | | ` abstract `[View](https://developer.android.com/reference/android/view/View)                        | ` `[newView](https://developer.android.com/reference/android/widget/CursorAdapter#newView(android.content.Context,%20android.database.Cursor,%20android.view.ViewGroup))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[Cursor](https://developer.android.com/reference/android/database/Cursor)` cursor, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Makes a new view to hold the data pointed to by cursor.                           | | ` void`                                                                                              | ` `[onContentChanged](https://developer.android.com/reference/android/widget/CursorAdapter#onContentChanged())`() ` Called when the[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)on the cursor receives a change notification.                                                                                                                                                                                                                                                   | | ` `[Cursor](https://developer.android.com/reference/android/database/Cursor)                         | ` `[runQueryOnBackgroundThread](https://developer.android.com/reference/android/widget/CursorAdapter#runQueryOnBackgroundThread(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` constraint) ` Runs a query with the specified constraint.                                                                                                                                                                                                                          | | ` void`                                                                                              | ` `[setDropDownViewTheme](https://developer.android.com/reference/android/widget/CursorAdapter#setDropDownViewTheme(android.content.res.Resources.Theme))`(`[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)` theme) ` Sets the[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)against which drop-down views are inflated.                                                                                                        | | ` void`                                                                                              | ` `[setFilterQueryProvider](https://developer.android.com/reference/android/widget/CursorAdapter#setFilterQueryProvider(android.widget.FilterQueryProvider))`(`[FilterQueryProvider](https://developer.android.com/reference/android/widget/FilterQueryProvider)` filterQueryProvider) ` Sets the query filter provider used to filter the current Cursor.                                                                                                                                                                    | | ` `[Cursor](https://developer.android.com/reference/android/database/Cursor)                         | ` `[swapCursor](https://developer.android.com/reference/android/widget/CursorAdapter#swapCursor(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor)` newCursor) ` Swap in a new Cursor, returning the old Cursor.                                                                                                                                                                                                                                                           | ||
| From class` `[android.widget.BaseAdapter](https://developer.android.com/reference/android/widget/BaseAdapter)` ` |-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` boolean`                                                                          | ` `[areAllItemsEnabled](https://developer.android.com/reference/android/widget/BaseAdapter#areAllItemsEnabled())`() ` Indicates whether all the items in this adapter are enabled.                                                                                                                                                                                                                                                                                                                                              | | ` `[CharSequence[]](https://developer.android.com/reference/java/lang/CharSequence) | ` `[getAutofillOptions](https://developer.android.com/reference/android/widget/BaseAdapter#getAutofillOptions())`() ` Gets a string representation of the adapter data that can help[AutofillService](https://developer.android.com/reference/android/service/autofill/AutofillService)autofill the view backed by the adapter.                                                                                                                                                                                                 | | ` `[View](https://developer.android.com/reference/android/view/View)                | ` `[getDropDownView](https://developer.android.com/reference/android/widget/BaseAdapter#getDropDownView(int,%20android.view.View,%20android.view.ViewGroup))`(int position, `[View](https://developer.android.com/reference/android/view/View)` convertView, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Gets a[View](https://developer.android.com/reference/android/view/View)that displays in the drop down popup the data at the specified position in the data set.            | | ` int`                                                                              | ` `[getItemViewType](https://developer.android.com/reference/android/widget/BaseAdapter#getItemViewType(int))`(int position) ` Get the type of View that will be created by[getView(int, View, ViewGroup)](https://developer.android.com/reference/android/widget/Adapter#getView(int,%20android.view.View,%20android.view.ViewGroup))for the specified item.                                                                                                                                                                   | | ` int`                                                                              | ` `[getViewTypeCount](https://developer.android.com/reference/android/widget/BaseAdapter#getViewTypeCount())`() ` <br /> Returns the number of types of Views that will be created by[getView(int, View, ViewGroup)](https://developer.android.com/reference/android/widget/Adapter#getView(int,%20android.view.View,%20android.view.ViewGroup)).                                                                                                                                                                               | | ` boolean`                                                                          | ` `[hasStableIds](https://developer.android.com/reference/android/widget/BaseAdapter#hasStableIds())`() ` Indicates whether the item ids are stable across changes to the underlying data.                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                          | ` `[isEmpty](https://developer.android.com/reference/android/widget/BaseAdapter#isEmpty())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` boolean`                                                                          | ` `[isEnabled](https://developer.android.com/reference/android/widget/BaseAdapter#isEnabled(int))`(int position) ` Returns true if the item at the specified position is not a separator.                                                                                                                                                                                                                                                                                                                                       | | ` void`                                                                             | ` `[notifyDataSetChanged](https://developer.android.com/reference/android/widget/BaseAdapter#notifyDataSetChanged())`() ` Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.                                                                                                                                                                                                                                                                 | | ` void`                                                                             | ` `[notifyDataSetInvalidated](https://developer.android.com/reference/android/widget/BaseAdapter#notifyDataSetInvalidated())`() ` Notifies the attached observers that the underlying data is no longer valid or available.                                                                                                                                                                                                                                                                                                     | | ` void`                                                                             | ` `[registerDataSetObserver](https://developer.android.com/reference/android/widget/BaseAdapter#registerDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Register an observer that is called when changes happen to the data used by this adapter.                                                                                                                                                                 | | ` void`                                                                             | ` `[setAutofillOptions](https://developer.android.com/reference/android/widget/BaseAdapter#setAutofillOptions(java.lang.CharSequence[]))`(`[CharSequence...](https://developer.android.com/reference/java/lang/CharSequence)` options) ` Sets the value returned by[getAutofillOptions()](https://developer.android.com/reference/android/widget/BaseAdapter#getAutofillOptions())                                                                                                                                              | | ` void`                                                                             | ` `[unregisterDataSetObserver](https://developer.android.com/reference/android/widget/BaseAdapter#unregisterDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Unregister an observer that has previously been registered with this adapter via[registerDataSetObserver(DataSetObserver)](https://developer.android.com/reference/android/widget/Adapter#registerDataSetObserver(android.database.DataSetObserver)). | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[android.widget.Filterable](https://developer.android.com/reference/android/widget/Filterable)` ` |-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Filter](https://developer.android.com/reference/android/widget/Filter) | ` `[getFilter](https://developer.android.com/reference/android/widget/Filterable#getFilter())`() ` <br /> Returns a filter that can be used to constrain data with a filtering pattern. | ||
| From interface` `[android.widget.ThemedSpinnerAdapter](https://developer.android.com/reference/android/widget/ThemedSpinnerAdapter)` ` |------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme) | ` `[getDropDownViewTheme](https://developer.android.com/reference/android/widget/ThemedSpinnerAdapter#getDropDownViewTheme())`() ` Returns the value previously set by a call to[setDropDownViewTheme(android.content.res.Resources.Theme)](https://developer.android.com/reference/android/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)).                                           | | ` abstract void`                                                                                           | ` `[setDropDownViewTheme](https://developer.android.com/reference/android/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme))`(`[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)` theme) ` Sets the[Resources.Theme](https://developer.android.com/reference/android/content/res/Resources.Theme)against which drop-down views are inflated. | ||
| From interface` `[android.widget.ListAdapter](https://developer.android.com/reference/android/widget/ListAdapter)` ` |---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean` | ` `[areAllItemsEnabled](https://developer.android.com/reference/android/widget/ListAdapter#areAllItemsEnabled())`() ` Indicates whether all the items in this adapter are enabled.        | | ` abstract boolean` | ` `[isEnabled](https://developer.android.com/reference/android/widget/ListAdapter#isEnabled(int))`(int position) ` Returns true if the item at the specified position is not a separator. | ||
| From interface` `[android.widget.SpinnerAdapter](https://developer.android.com/reference/android/widget/SpinnerAdapter)` ` |-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[View](https://developer.android.com/reference/android/view/View) | ` `[getDropDownView](https://developer.android.com/reference/android/widget/SpinnerAdapter#getDropDownView(int,%20android.view.View,%20android.view.ViewGroup))`(int position, `[View](https://developer.android.com/reference/android/view/View)` convertView, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Gets a[View](https://developer.android.com/reference/android/view/View)that displays in the drop down popup the data at the specified position in the data set. | ||
| From interface` `[android.widget.Adapter](https://developer.android.com/reference/android/widget/Adapter)` ` |---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` default `[CharSequence[]](https://developer.android.com/reference/java/lang/CharSequence) | ` `[getAutofillOptions](https://developer.android.com/reference/android/widget/Adapter#getAutofillOptions())`() ` Gets a string representation of the adapter data that can help[AutofillService](https://developer.android.com/reference/android/service/autofill/AutofillService)autofill the view backed by the adapter.                                                                                                                                                                                                 | | ` abstract int`                                                                             | ` `[getCount](https://developer.android.com/reference/android/widget/Adapter#getCount())`() ` How many items are in the data set represented by this Adapter.                                                                                                                                                                                                                                                                                                                                                               | | ` abstract `[Object](https://developer.android.com/reference/java/lang/Object)              | ` `[getItem](https://developer.android.com/reference/android/widget/Adapter#getItem(int))`(int position) ` Get the data item associated with the specified position in the data set.                                                                                                                                                                                                                                                                                                                                        | | ` abstract long`                                                                            | ` `[getItemId](https://developer.android.com/reference/android/widget/Adapter#getItemId(int))`(int position) ` Get the row id associated with the specified position in the list.                                                                                                                                                                                                                                                                                                                                           | | ` abstract int`                                                                             | ` `[getItemViewType](https://developer.android.com/reference/android/widget/Adapter#getItemViewType(int))`(int position) ` Get the type of View that will be created by[getView(int, View, ViewGroup)](https://developer.android.com/reference/android/widget/Adapter#getView(int,%20android.view.View,%20android.view.ViewGroup))for the specified item.                                                                                                                                                                   | | ` abstract `[View](https://developer.android.com/reference/android/view/View)               | ` `[getView](https://developer.android.com/reference/android/widget/Adapter#getView(int,%20android.view.View,%20android.view.ViewGroup))`(int position, `[View](https://developer.android.com/reference/android/view/View)` convertView, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)` parent) ` Get a View that displays the data at the specified position in the data set.                                                                                                               | | ` abstract int`                                                                             | ` `[getViewTypeCount](https://developer.android.com/reference/android/widget/Adapter#getViewTypeCount())`() ` <br /> Returns the number of types of Views that will be created by[getView(int, View, ViewGroup)](https://developer.android.com/reference/android/widget/Adapter#getView(int,%20android.view.View,%20android.view.ViewGroup)).                                                                                                                                                                               | | ` abstract boolean`                                                                         | ` `[hasStableIds](https://developer.android.com/reference/android/widget/Adapter#hasStableIds())`() ` Indicates whether the item ids are stable across changes to the underlying data.                                                                                                                                                                                                                                                                                                                                      | | ` abstract boolean`                                                                         | ` `[isEmpty](https://developer.android.com/reference/android/widget/Adapter#isEmpty())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` abstract void`                                                                            | ` `[registerDataSetObserver](https://developer.android.com/reference/android/widget/Adapter#registerDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Register an observer that is called when changes happen to the data used by this adapter.                                                                                                                                                                 | | ` abstract void`                                                                            | ` `[unregisterDataSetObserver](https://developer.android.com/reference/android/widget/Adapter#unregisterDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Unregister an observer that has previously been registered with this adapter via[registerDataSetObserver(DataSetObserver)](https://developer.android.com/reference/android/widget/Adapter#registerDataSetObserver(android.database.DataSetObserver)). | ||

## Public constructors

### SimpleCursorAdapter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public SimpleCursorAdapter (Context context, 
                int layout, 
                Cursor c, 
                String[] from, 
                int[] to)
```

<br />

**This constructor 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. As an alternative, use[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager)with a[CursorLoader](https://developer.android.com/reference/android/content/CursorLoader).

Constructor the enables auto-requery.

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |
| `layout`  | `int` <br />     |
| `c`       | `Cursor` <br />  |
| `from`    | `String` <br />  |
| `to`      | `int` <br />     |

### SimpleCursorAdapter

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public SimpleCursorAdapter (Context context, 
                int layout, 
                Cursor c, 
                String[] from, 
                int[] to, 
                int flags)
```

Standard constructor.

<br />

|                                                                                                                                       Parameters                                                                                                                                        ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context` | `Context`: The context where the ListView associated with this SimpleListItemFactory is running <br />                                                                                                                                                                       |
| `layout`  | `int`: resource identifier of a layout file that defines the views for this list item. The layout file should include at least those named views defined in "to" <br />                                                                                                      |
| `c`       | `Cursor`: The database cursor. Can be null if the cursor is not available yet. <br />                                                                                                                                                                                        |
| `from`    | `String`: A list of column names representing the data to bind to the UI. Can be null if the cursor is not available yet. <br />                                                                                                                                             |
| `to`      | `int`: The views that should display column in the "from" parameter. These should all be TextViews. The first N views in this list are given the values of the first N columns in the from parameter. Can be null if the cursor is not available yet. <br />                 |
| `flags`   | `int`: Flags used to determine the behavior of the adapter, as per[CursorAdapter.CursorAdapter(Context, Cursor, int)](https://developer.android.com/reference/android/widget/CursorAdapter#CursorAdapter(android.content.Context,%20android.database.Cursor,%20int)). <br /> |

## Public methods

### bindView

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void bindView (View view, 
                Context context, 
                Cursor cursor)
```

Binds all of the field names passed into the "to" parameter of the constructor with their corresponding cursor columns as specified in the "from" parameter. Binding occurs in two phases. First, if a[SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)is available,[ViewBinder.setViewValue(android.view.View, android.database.Cursor, int)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder#setViewValue(android.view.View,%20android.database.Cursor,%20int))is invoked. If the returned value is true, binding has occured. If the returned value is false and the view to bind is a TextView,[setViewText(android.widget.TextView, java.lang.String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewText(android.widget.TextView,%20java.lang.String))is invoked. If the returned value is false and the view to bind is an ImageView,[setViewImage(android.widget.ImageView, java.lang.String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewImage(android.widget.ImageView,%20java.lang.String))is invoked. If no appropriate binding can be found, an[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)is thrown.

<br />

|                                                       Parameters                                                        ||
|-----------|--------------------------------------------------------------------------------------------------------------|
| `view`    | `View`: Existing view, returned earlier by newView <br />                                                    |
| `context` | `Context`: Interface to application's global information <br />                                              |
| `cursor`  | `Cursor`: The cursor from which to get the data. The cursor is already moved to the correct position. <br /> |

|                                                          Throws                                                           ||
|--------------------------------------------------------------------------------------------------|-------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException) | if binding cannot occur |

**See also:**

- [CursorAdapter.bindView(android.view.View, android.content.Context, android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#bindView(android.view.View,%20android.content.Context,%20android.database.Cursor))
- [getViewBinder()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getViewBinder())
- [setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder))
- [setViewImage(ImageView, String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewImage(android.widget.ImageView,%20java.lang.String))
- [setViewText(TextView, String)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewText(android.widget.TextView,%20java.lang.String))  

### changeCursorAndColumns

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void changeCursorAndColumns (Cursor c, 
                String[] from, 
                int[] to)
```

Change the cursor and change the column-to-view mappings at the same time.

<br />

|                                                                                                                              Parameters                                                                                                                              ||
|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `c`    | `Cursor`: The database cursor. Can be null if the cursor is not available yet. <br />                                                                                                                                                                        |
| `from` | `String`: A list of column names representing the data to bind to the UI. Can be null if the cursor is not available yet. <br />                                                                                                                             |
| `to`   | `int`: The views that should display column in the "from" parameter. These should all be TextViews. The first N views in this list are given the values of the first N columns in the from parameter. Can be null if the cursor is not available yet. <br /> |

### convertToString

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence convertToString (Cursor cursor)
```

Returns a CharSequence representation of the specified Cursor as defined by the current CursorToStringConverter. If no CursorToStringConverter has been set, the String conversion column is used instead. If the conversion column is -1, the returned String is empty if the cursor is null or Cursor.toString().

<br />

|                             Parameters                             ||
|----------|----------------------------------------------------------|
| `cursor` | `Cursor`: the Cursor to convert to a CharSequence <br /> |

|                                                                Returns                                                                 ||
|--------------------------------------------------------------------------------|--------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | a non-null CharSequence representing the cursor <br /> |

### getCursorToStringConverter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public SimpleCursorAdapter.CursorToStringConverter getCursorToStringConverter ()
```

Returns the converter used to convert the filtering Cursor into a String.

<br />

|                                                                                                                                                                              Returns                                                                                                                                                                              ||
|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter) | null if the converter does not exist or an instance of[SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.CursorToStringConverter) <br /> |

**See also:**

- [setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter))
- [getStringConversionColumn()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getStringConversionColumn())
- [setStringConversionColumn(int)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setStringConversionColumn(int))
- [CursorAdapter.convertToString(android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#convertToString(android.database.Cursor))  

### getStringConversionColumn

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getStringConversionColumn ()
```

Return the index of the column used to get a String representation of the Cursor.

<br />

|                         Returns                         ||
|-------|--------------------------------------------------|
| `int` | a valid index in the current Cursor or -1 <br /> |

**See also:**

- [CursorAdapter.convertToString(android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#convertToString(android.database.Cursor))
- [setStringConversionColumn(int)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setStringConversionColumn(int))
- [setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter))
- [getCursorToStringConverter()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getCursorToStringConverter())  

### getViewBinder

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public SimpleCursorAdapter.ViewBinder getViewBinder ()
```

Returns the[ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder)used to bind data to views.

<br />

|                                                                                      Returns                                                                                      ||
|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder) | a ViewBinder or null if the binder does not exist <br /> |

**See also:**

- [bindView(android.view.View, android.content.Context, android.database.Cursor)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#bindView(android.view.View,%20android.content.Context,%20android.database.Cursor))
- [setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder))  

### setCursorToStringConverter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setCursorToStringConverter (SimpleCursorAdapter.CursorToStringConverter cursorToStringConverter)
```

Sets the converter used to convert the filtering Cursor into a String.

<br />

|                                                                    Parameters                                                                    ||
|---------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `cursorToStringConverter` | `SimpleCursorAdapter.CursorToStringConverter`: the Cursor to String converter, or null to remove the converter <br /> |

**See also:**

- [setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter))
- [getStringConversionColumn()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getStringConversionColumn())
- [setStringConversionColumn(int)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setStringConversionColumn(int))
- [CursorAdapter.convertToString(android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#convertToString(android.database.Cursor))  

### setStringConversionColumn

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setStringConversionColumn (int stringConversionColumn)
```

Defines the index of the column in the Cursor used to get a String representation of that Cursor. The column is used to convert the Cursor to a String only when the current CursorToStringConverter is null.

<br />

|                                                        Parameters                                                         ||
|--------------------------|-------------------------------------------------------------------------------------------------|
| `stringConversionColumn` | `int`: a valid index in the current Cursor or -1 to use the default conversion mechanism <br /> |

**See also:**

- [CursorAdapter.convertToString(android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#convertToString(android.database.Cursor))
- [getStringConversionColumn()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getStringConversionColumn())
- [setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter))
- [getCursorToStringConverter()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getCursorToStringConverter())  

### setViewBinder

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setViewBinder (SimpleCursorAdapter.ViewBinder viewBinder)
```

Sets the binder used to bind data to views.

<br />

|                                                               Parameters                                                                ||
|--------------|---------------------------------------------------------------------------------------------------------------------------|
| `viewBinder` | `SimpleCursorAdapter.ViewBinder`: the binder used to bind data to views, can be null to remove the existing binder <br /> |

**See also:**

- [bindView(android.view.View, android.content.Context, android.database.Cursor)](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#bindView(android.view.View,%20android.content.Context,%20android.database.Cursor))
- [getViewBinder()](https://developer.android.com/reference/android/widget/SimpleCursorAdapter#getViewBinder())  

### setViewImage

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setViewImage (ImageView v, 
                String value)
```

Called by bindView() to set the image for an ImageView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to an ImageView. By default, the value will be treated as an image resource. If the value cannot be used as an image resource, the value is used as an image Uri. Intended to be overridden by Adapters that need to filter strings retrieved from the database.

<br />

|                          Parameters                           ||
|---------|------------------------------------------------------|
| `v`     | `ImageView`: ImageView to receive an image <br />    |
| `value` | `String`: the value retrieved from the cursor <br /> |

### setViewText

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setViewText (TextView v, 
                String text)
```

Called by bindView() to set the text for a TextView but only if there is no existing ViewBinder or if the existing ViewBinder cannot handle binding to a TextView. Intended to be overridden by Adapters that need to filter strings retrieved from the database.

<br />

|                          Parameters                          ||
|--------|------------------------------------------------------|
| `v`    | `TextView`: TextView to receive text <br />          |
| `text` | `String`: the text to be set for the TextView <br /> |

### swapCursor

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Cursor swapCursor (Cursor c)
```

Swap in a new Cursor, returning the old Cursor. Unlike[changeCursor(android.database.Cursor)](https://developer.android.com/reference/android/widget/CursorAdapter#changeCursor(android.database.Cursor)), the returned old Cursor is*not*closed.

<br />

|                    Parameters                    ||
|-----|---------------------------------------------|
| `c` | `Cursor`: The new cursor to be used. <br /> |

|                                                                                                                       Returns                                                                                                                        ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Cursor](https://developer.android.com/reference/android/database/Cursor) | Returns the previously set Cursor, or null if there was not one. If the given new Cursor is the same instance is the previously set Cursor, null is also returned. <br /> |