# MockCursor

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Inherited Constants](https://developer.android.com/reference/android/test/mock/MockCursor#inhconstants)\|[Ctors](https://developer.android.com/reference/android/test/mock/MockCursor#pubctors)\|[Methods](https://developer.android.com/reference/android/test/mock/MockCursor#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/test/mock/MockCursor#inhmethods)  

# MockCursor

*** ** * ** ***

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

`
public


class
MockCursor
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Cursor](https://developer.android.com/reference/android/database/Cursor)`


`

|---|------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.test.mock.MockCursor |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 24.**   
Use a mocking framework like[Mockito](https://github.com/mockito/mockito). New tests should be written using the[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).

A mock[Cursor](https://developer.android.com/reference/android/database/Cursor)class that isolates the test code from real Cursor implementation.

All methods including ones related to querying the state of the cursor are are non-functional and throw[UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.database.Cursor](https://developer.android.com/reference/android/database/Cursor) |-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [FIELD_TYPE_BLOB](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_BLOB) Value returned by[getType(int)](https://developer.android.com/reference/android/database/Cursor#getType(int))if the specified column type is blob          | | `int` | [FIELD_TYPE_FLOAT](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_FLOAT) Value returned by[getType(int)](https://developer.android.com/reference/android/database/Cursor#getType(int))if the specified column type is float       | | `int` | [FIELD_TYPE_INTEGER](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_INTEGER) Value returned by[getType(int)](https://developer.android.com/reference/android/database/Cursor#getType(int))if the specified column type is integer | | `int` | [FIELD_TYPE_NULL](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_NULL) Value returned by[getType(int)](https://developer.android.com/reference/android/database/Cursor#getType(int))if the specified column is null               | | `int` | [FIELD_TYPE_STRING](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_STRING) Value returned by[getType(int)](https://developer.android.com/reference/android/database/Cursor#getType(int))if the specified column type is string    | |

|                                          ### Public constructors                                           ||
|---------------------------------------------------------------------------------------------------------|---|
| ` `[MockCursor](https://developer.android.com/reference/android/test/mock/MockCursor#MockCursor())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                             ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                                               | ` `[close](https://developer.android.com/reference/android/test/mock/MockCursor#close())`() ` Closes the Cursor, releasing all of its resources and making it completely invalid.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                               | ` `[copyStringToBuffer](https://developer.android.com/reference/android/test/mock/MockCursor#copyStringToBuffer(int,%20android.database.CharArrayBuffer))`(int columnIndex, `[CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer)` buffer) ` Retrieves the requested column text and stores it in the buffer provided.                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                                                               | ` `[deactivate](https://developer.android.com/reference/android/test/mock/MockCursor#deactivate())`() ` Deactivates the Cursor, making all calls on it fail until[requery()](https://developer.android.com/reference/android/database/Cursor#requery())is called.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` byte[]`                                                                                                                             | ` `[getBlob](https://developer.android.com/reference/android/test/mock/MockCursor#getBlob(int))`(int columnIndex) ` Returns the value of the requested column as a byte array.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` int`                                                                                                                                | ` `[getColumnCount](https://developer.android.com/reference/android/test/mock/MockCursor#getColumnCount())`() ` Return total number of columns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` int`                                                                                                                                | ` `[getColumnIndex](https://developer.android.com/reference/android/test/mock/MockCursor#getColumnIndex(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` columnName) ` Returns the zero-based index for the given column name, or -1 if the column doesn't exist.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` int`                                                                                                                                | ` `[getColumnIndexOrThrow](https://developer.android.com/reference/android/test/mock/MockCursor#getColumnIndexOrThrow(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` columnName) ` Returns the zero-based index for the given column name, or throws[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)if the column doesn't exist.                                                                                                                                                                                                                                                                                                     |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                                                 | ` `[getColumnName](https://developer.android.com/reference/android/test/mock/MockCursor#getColumnName(int))`(int columnIndex) ` Returns the column name at the given zero-based column index.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` `[String[]](https://developer.android.com/reference/java/lang/String)                                                               | ` `[getColumnNames](https://developer.android.com/reference/android/test/mock/MockCursor#getColumnNames())`() ` Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` int`                                                                                                                                | ` `[getCount](https://developer.android.com/reference/android/test/mock/MockCursor#getCount())`() ` Returns the numbers of rows in the cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` double`                                                                                                                             | ` `[getDouble](https://developer.android.com/reference/android/test/mock/MockCursor#getDouble(int))`(int columnIndex) ` Returns the value of the requested column as a double.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                                | ` `[getExtras](https://developer.android.com/reference/android/test/mock/MockCursor#getExtras())`() ` Returns a bundle of extra values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` float`                                                                                                                              | ` `[getFloat](https://developer.android.com/reference/android/test/mock/MockCursor#getFloat(int))`(int columnIndex) ` Returns the value of the requested column as a float.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` int`                                                                                                                                | ` `[getInt](https://developer.android.com/reference/android/test/mock/MockCursor#getInt(int))`(int columnIndex) ` Returns the value of the requested column as an int.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` long`                                                                                                                               | ` `[getLong](https://developer.android.com/reference/android/test/mock/MockCursor#getLong(int))`(int columnIndex) ` Returns the value of the requested column as a long.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                     | ` `[getNotificationUri](https://developer.android.com/reference/android/test/mock/MockCursor#getNotificationUri())`() ` Return the URI at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUri(ContentResolver, Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)).                                                                                                                                                                                                                                                                                                            |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`>` | ` `[getNotificationUris](https://developer.android.com/reference/android/test/mock/MockCursor#getNotificationUris())`() ` Return the URIs at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUris(ContentResolver, List)](https://developer.android.com/reference/android/database/Cursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>)).                                                                                                                                                                                                                                                                                      |
| ` int`                                                                                                                                | ` `[getPosition](https://developer.android.com/reference/android/test/mock/MockCursor#getPosition())`() ` Returns the current position of the cursor in the row set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` short`                                                                                                                              | ` `[getShort](https://developer.android.com/reference/android/test/mock/MockCursor#getShort(int))`(int columnIndex) ` Returns the value of the requested column as a short.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                                                 | ` `[getString](https://developer.android.com/reference/android/test/mock/MockCursor#getString(int))`(int columnIndex) ` Returns the value of the requested column as a String.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` int`                                                                                                                                | ` `[getType](https://developer.android.com/reference/android/test/mock/MockCursor#getType(int))`(int columnIndex) ` Returns data type of the given column's value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` boolean`                                                                                                                            | ` `[getWantsAllOnMoveCalls](https://developer.android.com/reference/android/test/mock/MockCursor#getWantsAllOnMoveCalls())`() ` onMove() will only be called across processes if this method returns true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` boolean`                                                                                                                            | ` `[isAfterLast](https://developer.android.com/reference/android/test/mock/MockCursor#isAfterLast())`() ` Returns whether the cursor is pointing to the position after the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` boolean`                                                                                                                            | ` `[isBeforeFirst](https://developer.android.com/reference/android/test/mock/MockCursor#isBeforeFirst())`() ` Returns whether the cursor is pointing to the position before the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` boolean`                                                                                                                            | ` `[isClosed](https://developer.android.com/reference/android/test/mock/MockCursor#isClosed())`() ` return true if the cursor is closed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` boolean`                                                                                                                            | ` `[isFirst](https://developer.android.com/reference/android/test/mock/MockCursor#isFirst())`() ` Returns whether the cursor is pointing to the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` boolean`                                                                                                                            | ` `[isLast](https://developer.android.com/reference/android/test/mock/MockCursor#isLast())`() ` Returns whether the cursor is pointing to the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` boolean`                                                                                                                            | ` `[isNull](https://developer.android.com/reference/android/test/mock/MockCursor#isNull(int))`(int columnIndex) ` Returns`true`if the value in the indicated column is null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` boolean`                                                                                                                            | ` `[move](https://developer.android.com/reference/android/test/mock/MockCursor#move(int))`(int offset) ` Move the cursor by a relative amount, forward or backward, from the current position.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` boolean`                                                                                                                            | ` `[moveToFirst](https://developer.android.com/reference/android/test/mock/MockCursor#moveToFirst())`() ` Move the cursor to the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` boolean`                                                                                                                            | ` `[moveToLast](https://developer.android.com/reference/android/test/mock/MockCursor#moveToLast())`() ` Move the cursor to the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` boolean`                                                                                                                            | ` `[moveToNext](https://developer.android.com/reference/android/test/mock/MockCursor#moveToNext())`() ` Move the cursor to the next row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` boolean`                                                                                                                            | ` `[moveToPosition](https://developer.android.com/reference/android/test/mock/MockCursor#moveToPosition(int))`(int position) ` Move the cursor to an absolute position.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` boolean`                                                                                                                            | ` `[moveToPrevious](https://developer.android.com/reference/android/test/mock/MockCursor#moveToPrevious())`() ` Move the cursor to the previous row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` void`                                                                                                                               | ` `[registerContentObserver](https://developer.android.com/reference/android/test/mock/MockCursor#registerContentObserver(android.database.ContentObserver))`(`[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Register an observer that is called when changes happen to the content backing this cursor.                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                                               | ` `[registerDataSetObserver](https://developer.android.com/reference/android/test/mock/MockCursor#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 contents of the this cursors data set, for example, when the data set is changed via[requery()](https://developer.android.com/reference/android/database/Cursor#requery()),[deactivate()](https://developer.android.com/reference/android/database/Cursor#deactivate()), or[close()](https://developer.android.com/reference/android/database/Cursor#close()).                                |
| ` boolean`                                                                                                                            | ` `[requery](https://developer.android.com/reference/android/test/mock/MockCursor#requery())`() ` Performs the query that created the cursor again, refreshing its contents.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                                | ` `[respond](https://developer.android.com/reference/android/test/mock/MockCursor#respond(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` This is an out-of-band way for the user of a cursor to communicate with the cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                                               | ` `[setExtras](https://developer.android.com/reference/android/test/mock/MockCursor#setExtras(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Sets a[Bundle](https://developer.android.com/reference/android/os/Bundle)that will be returned by[getExtras()](https://developer.android.com/reference/android/database/Cursor#getExtras()).                                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                                               | ` `[setNotificationUri](https://developer.android.com/reference/android/test/mock/MockCursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` cr, `[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Register to watch a content URI for changes.                                                                                                                                                                                                                                                                                                                                          |
| ` void`                                                                                                                               | ` `[setNotificationUris](https://developer.android.com/reference/android/test/mock/MockCursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` cr, `[List](https://developer.android.com/reference/java/util/List)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`> uris) ` Similar to[setNotificationUri(android.content.ContentResolver, android.net.Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)), except this version allows to watch multiple content URIs for changes. |
| ` void`                                                                                                                               | ` `[unregisterContentObserver](https://developer.android.com/reference/android/test/mock/MockCursor#unregisterContentObserver(android.database.ContentObserver))`(`[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).                                                                                                                                                                                                    |
| ` void`                                                                                                                               | ` `[unregisterDataSetObserver](https://developer.android.com/reference/android/test/mock/MockCursor#unregisterDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).                                                                                                                                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| 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.database.Cursor](https://developer.android.com/reference/android/database/Cursor)` ` |-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`                                                                                                                              | ` `[close](https://developer.android.com/reference/android/database/Cursor#close())`() ` Closes the Cursor, releasing all of its resources and making it completely invalid.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` abstract void`                                                                                                                              | ` `[copyStringToBuffer](https://developer.android.com/reference/android/database/Cursor#copyStringToBuffer(int,%20android.database.CharArrayBuffer))`(int columnIndex, `[CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer)` buffer) ` Retrieves the requested column text and stores it in the buffer provided.                                                                                                                                                                                                                                                                                                                                                                        | | ` abstract void`                                                                                                                              | ` `[deactivate](https://developer.android.com/reference/android/database/Cursor#deactivate())`() ` *This method was deprecated in API level 16. Since[requery()](https://developer.android.com/reference/android/database/Cursor#requery())is deprecated, so too is this.*                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract byte[]`                                                                                                                            | ` `[getBlob](https://developer.android.com/reference/android/database/Cursor#getBlob(int))`(int columnIndex) ` Returns the value of the requested column as a byte array.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract int`                                                                                                                               | ` `[getColumnCount](https://developer.android.com/reference/android/database/Cursor#getColumnCount())`() ` Return total number of columns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract int`                                                                                                                               | ` `[getColumnIndex](https://developer.android.com/reference/android/database/Cursor#getColumnIndex(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` columnName) ` Returns the zero-based index for the given column name, or -1 if the column doesn't exist.                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` abstract int`                                                                                                                               | ` `[getColumnIndexOrThrow](https://developer.android.com/reference/android/database/Cursor#getColumnIndexOrThrow(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` columnName) ` Returns the zero-based index for the given column name, or throws[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)if the column doesn't exist.                                                                                                                                                                                                                                                                                                     | | ` abstract `[String](https://developer.android.com/reference/java/lang/String)                                                                | ` `[getColumnName](https://developer.android.com/reference/android/database/Cursor#getColumnName(int))`(int columnIndex) ` Returns the column name at the given zero-based column index.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` abstract `[String[]](https://developer.android.com/reference/java/lang/String)                                                              | ` `[getColumnNames](https://developer.android.com/reference/android/database/Cursor#getColumnNames())`() ` Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` abstract int`                                                                                                                               | ` `[getCount](https://developer.android.com/reference/android/database/Cursor#getCount())`() ` Returns the numbers of rows in the cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract double`                                                                                                                            | ` `[getDouble](https://developer.android.com/reference/android/database/Cursor#getDouble(int))`(int columnIndex) ` Returns the value of the requested column as a double.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                               | ` `[getExtras](https://developer.android.com/reference/android/database/Cursor#getExtras())`() ` Returns a bundle of extra values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract float`                                                                                                                             | ` `[getFloat](https://developer.android.com/reference/android/database/Cursor#getFloat(int))`(int columnIndex) ` Returns the value of the requested column as a float.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` abstract int`                                                                                                                               | ` `[getInt](https://developer.android.com/reference/android/database/Cursor#getInt(int))`(int columnIndex) ` Returns the value of the requested column as an int.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` abstract long`                                                                                                                              | ` `[getLong](https://developer.android.com/reference/android/database/Cursor#getLong(int))`(int columnIndex) ` Returns the value of the requested column as a long.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract `[Uri](https://developer.android.com/reference/android/net/Uri)                                                                    | ` `[getNotificationUri](https://developer.android.com/reference/android/database/Cursor#getNotificationUri())`() ` Return the URI at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUri(ContentResolver, Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)).                                                                                                                                                                                                                                                                                                            | | ` default `[List](https://developer.android.com/reference/java/util/List)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`>` | ` `[getNotificationUris](https://developer.android.com/reference/android/database/Cursor#getNotificationUris())`() ` Return the URIs at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUris(ContentResolver, List)](https://developer.android.com/reference/android/database/Cursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>)).                                                                                                                                                                                                                                                                                      | | ` abstract int`                                                                                                                               | ` `[getPosition](https://developer.android.com/reference/android/database/Cursor#getPosition())`() ` Returns the current position of the cursor in the row set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` abstract short`                                                                                                                             | ` `[getShort](https://developer.android.com/reference/android/database/Cursor#getShort(int))`(int columnIndex) ` Returns the value of the requested column as a short.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` abstract `[String](https://developer.android.com/reference/java/lang/String)                                                                | ` `[getString](https://developer.android.com/reference/android/database/Cursor#getString(int))`(int columnIndex) ` Returns the value of the requested column as a String.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract int`                                                                                                                               | ` `[getType](https://developer.android.com/reference/android/database/Cursor#getType(int))`(int columnIndex) ` Returns data type of the given column's value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` abstract boolean`                                                                                                                           | ` `[getWantsAllOnMoveCalls](https://developer.android.com/reference/android/database/Cursor#getWantsAllOnMoveCalls())`() ` onMove() will only be called across processes if this method returns true.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` abstract boolean`                                                                                                                           | ` `[isAfterLast](https://developer.android.com/reference/android/database/Cursor#isAfterLast())`() ` Returns whether the cursor is pointing to the position after the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` abstract boolean`                                                                                                                           | ` `[isBeforeFirst](https://developer.android.com/reference/android/database/Cursor#isBeforeFirst())`() ` Returns whether the cursor is pointing to the position before the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` abstract boolean`                                                                                                                           | ` `[isClosed](https://developer.android.com/reference/android/database/Cursor#isClosed())`() ` return true if the cursor is closed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract boolean`                                                                                                                           | ` `[isFirst](https://developer.android.com/reference/android/database/Cursor#isFirst())`() ` Returns whether the cursor is pointing to the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` abstract boolean`                                                                                                                           | ` `[isLast](https://developer.android.com/reference/android/database/Cursor#isLast())`() ` Returns whether the cursor is pointing to the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract boolean`                                                                                                                           | ` `[isNull](https://developer.android.com/reference/android/database/Cursor#isNull(int))`(int columnIndex) ` Returns`true`if the value in the indicated column is null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ` abstract boolean`                                                                                                                           | ` `[move](https://developer.android.com/reference/android/database/Cursor#move(int))`(int offset) ` Move the cursor by a relative amount, forward or backward, from the current position.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract boolean`                                                                                                                           | ` `[moveToFirst](https://developer.android.com/reference/android/database/Cursor#moveToFirst())`() ` Move the cursor to the first row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` abstract boolean`                                                                                                                           | ` `[moveToLast](https://developer.android.com/reference/android/database/Cursor#moveToLast())`() ` Move the cursor to the last row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract boolean`                                                                                                                           | ` `[moveToNext](https://developer.android.com/reference/android/database/Cursor#moveToNext())`() ` Move the cursor to the next row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract boolean`                                                                                                                           | ` `[moveToPosition](https://developer.android.com/reference/android/database/Cursor#moveToPosition(int))`(int position) ` Move the cursor to an absolute position.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract boolean`                                                                                                                           | ` `[moveToPrevious](https://developer.android.com/reference/android/database/Cursor#moveToPrevious())`() ` Move the cursor to the previous row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` abstract void`                                                                                                                              | ` `[registerContentObserver](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver))`(`[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Register an observer that is called when changes happen to the content backing this cursor.                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract void`                                                                                                                              | ` `[registerDataSetObserver](https://developer.android.com/reference/android/database/Cursor#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 contents of the this cursors data set, for example, when the data set is changed via[requery()](https://developer.android.com/reference/android/database/Cursor#requery()),[deactivate()](https://developer.android.com/reference/android/database/Cursor#deactivate()), or[close()](https://developer.android.com/reference/android/database/Cursor#close()).                                | | ` abstract boolean`                                                                                                                           | ` `[requery](https://developer.android.com/reference/android/database/Cursor#requery())`() ` *This method was deprecated in API level 15. Don't use this. Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back.*                                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` abstract `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                               | ` `[respond](https://developer.android.com/reference/android/database/Cursor#respond(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` This is an out-of-band way for the user of a cursor to communicate with the cursor.                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` abstract void`                                                                                                                              | ` `[setExtras](https://developer.android.com/reference/android/database/Cursor#setExtras(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Sets a[Bundle](https://developer.android.com/reference/android/os/Bundle)that will be returned by[getExtras()](https://developer.android.com/reference/android/database/Cursor#getExtras()).                                                                                                                                                                                                                                                                                                                                      | | ` abstract void`                                                                                                                              | ` `[setNotificationUri](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` cr, `[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Register to watch a content URI for changes.                                                                                                                                                                                                                                                                                                                                          | | ` default void`                                                                                                                               | ` `[setNotificationUris](https://developer.android.com/reference/android/database/Cursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` cr, `[List](https://developer.android.com/reference/java/util/List)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`> uris) ` Similar to[setNotificationUri(android.content.ContentResolver, android.net.Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)), except this version allows to watch multiple content URIs for changes. | | ` abstract void`                                                                                                                              | ` `[unregisterContentObserver](https://developer.android.com/reference/android/database/Cursor#unregisterContentObserver(android.database.ContentObserver))`(`[ContentObserver](https://developer.android.com/reference/android/database/ContentObserver)` observer) ` Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).                                                                                                                                                                                                    | | ` abstract void`                                                                                                                              | ` `[unregisterDataSetObserver](https://developer.android.com/reference/android/database/Cursor#unregisterDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](https://developer.android.com/reference/android/database/DataSetObserver)` observer) ` Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).                                                                                                                                                                                                    | ||
| From interface` `[java.io.Closeable](https://developer.android.com/reference/java/io/Closeable)` ` |------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[close](https://developer.android.com/reference/java/io/Closeable#close())`() ` Closes this stream and releases any system resources associated with it. | ||
| From interface` `[java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable)` ` |------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[close](https://developer.android.com/reference/java/lang/AutoCloseable#close())`() ` Closes this resource, relinquishing any underlying resources. | ||

## Public constructors

### MockCursor

```
public MockCursor ()
```

<br />

<br />

## Public methods

### close

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

```
public void close ()
```

Closes the Cursor, releasing all of its resources and making it completely invalid. Unlike[deactivate()](https://developer.android.com/reference/android/database/Cursor#deactivate())a call to[requery()](https://developer.android.com/reference/android/database/Cursor#requery())will not make the Cursor valid again.

<br />

### copyStringToBuffer

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

```
public void copyStringToBuffer (int columnIndex, 
                CharArrayBuffer buffer)
```

Retrieves the requested column text and stores it in the buffer provided. If the buffer size is not sufficient, a new char buffer will be allocated and assigned to CharArrayBuffer.data

<br />

|                                                                Parameters                                                                 ||
|---------------|----------------------------------------------------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. if the target column is null, return buffer Value is 0 or greater <br /> |
| `buffer`      | `CharArrayBuffer`: the buffer to copy the text into. <br />                                                                |

### deactivate

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

```
public void deactivate ()
```

Deactivates the Cursor, making all calls on it fail until[requery()](https://developer.android.com/reference/android/database/Cursor#requery())is called. Inactive Cursors use fewer resources than active Cursors. Calling[requery()](https://developer.android.com/reference/android/database/Cursor#requery())will make the cursor active again.

<br />

### getBlob

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

```
public byte[] getBlob (int columnIndex)
```

Returns the value of the requested column as a byte array.

The result and whether this method throws an exception when the column value is null or the column type is not a blob type is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                          Returns                           ||
|----------|--------------------------------------------------|
| `byte[]` | the value of that column as a byte array. <br /> |

### getColumnCount

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

```
public int getColumnCount ()
```

Return total number of columns

<br />

|                        Returns                        ||
|-------|------------------------------------------------|
| `int` | number of columns Value is 0 or greater <br /> |

### getColumnIndex

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

```
public int getColumnIndex (String columnName)
```

Returns the zero-based index for the given column name, or -1 if the column doesn't exist. If you expect the column to exist use[getColumnIndexOrThrow(java.lang.String)](https://developer.android.com/reference/android/database/Cursor#getColumnIndexOrThrow(java.lang.String))instead, which will make the error more clear.

<br />

|                          Parameters                           ||
|--------------|-------------------------------------------------|
| `columnName` | `String`: the name of the target column. <br /> |

|                                                               Returns                                                                ||
|-------|-------------------------------------------------------------------------------------------------------------------------------|
| `int` | the zero-based column index for the given column name, or -1 if the column name does not exist. Value is -1 or greater <br /> |

### getColumnIndexOrThrow

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

```
public int getColumnIndexOrThrow (String columnName)
```

Returns the zero-based index for the given column name, or throws[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)if the column doesn't exist. If you're not sure if a column will exist or not use[getColumnIndex(java.lang.String)](https://developer.android.com/reference/android/database/Cursor#getColumnIndex(java.lang.String))and check for -1, which is more efficient than catching the exceptions.

<br />

|                          Parameters                           ||
|--------------|-------------------------------------------------|
| `columnName` | `String`: the name of the target column. <br /> |

|                                          Returns                                          ||
|-------|------------------------------------------------------------------------------------|
| `int` | the zero-based column index for the given column name Value is 0 or greater <br /> |

### getColumnName

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

```
public String getColumnName (int columnIndex)
```

Returns the column name at the given zero-based column index.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                                                        Returns                                                         ||
|--------------------------------------------------------------------|----------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the column name for the given column index. <br /> |

### getColumnNames

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

```
public String[] getColumnNames ()
```

Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.

<br />

|                                                            Returns                                                            ||
|----------------------------------------------------------------------|---------------------------------------------------------|
| [String[]](https://developer.android.com/reference/java/lang/String) | the names of the columns returned in this query. <br /> |

### getCount

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

```
public int getCount ()
```

Returns the numbers of rows in the cursor.

<br />

|                                Returns                                ||
|-------|----------------------------------------------------------------|
| `int` | the number of rows in the cursor. Value is 0 or greater <br /> |

### getDouble

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

```
public double getDouble (int columnIndex)
```

Returns the value of the requested column as a double.

The result and whether this method throws an exception when the column value is null, the column type is not a floating-point type, or the floating-point value is not representable as a`double`value is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                        Returns                         ||
|----------|----------------------------------------------|
| `double` | the value of that column as a double. <br /> |

### getExtras

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

```
public Bundle getExtras ()
```

Returns a bundle of extra values. This is an optional way for cursors to provide out-of-band metadata to their users. One use of this is for reporting on the progress of network requests that are required to fetch data for the cursor.

These values may only change when requery is called.

<br />

|                                                                                                         Returns                                                                                                          ||
|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | cursor-defined values, or[Bundle.EMPTY](https://developer.android.com/reference/android/os/Bundle#EMPTY)if there are no values. Never`null`. <br /> |

### getFloat

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

```
public float getFloat (int columnIndex)
```

Returns the value of the requested column as a float.

The result and whether this method throws an exception when the column value is null, the column type is not a floating-point type, or the floating-point value is not representable as a`float`value is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                       Returns                        ||
|---------|---------------------------------------------|
| `float` | the value of that column as a float. <br /> |

### getInt

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

```
public int getInt (int columnIndex)
```

Returns the value of the requested column as an int.

The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range \[`Integer.MIN_VALUE`,`Integer.MAX_VALUE`\] is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                      Returns                      ||
|-------|--------------------------------------------|
| `int` | the value of that column as an int. <br /> |

### getLong

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

```
public long getLong (int columnIndex)
```

Returns the value of the requested column as a long.

The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range \[`Long.MIN_VALUE`,`Long.MAX_VALUE`\] is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                      Returns                       ||
|--------|--------------------------------------------|
| `long` | the value of that column as a long. <br /> |

### getNotificationUri

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

```
public Uri getNotificationUri ()
```

Return the URI at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUri(ContentResolver, Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)).

<br />

|                                                                                                                                                                                                        Returns                                                                                                                                                                                                        ||
|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | Returns a URI that can be used with[ContentResolver.registerContentObserver](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver))to find out about changes to this Cursor's data. May be null if no notification URI has been set. <br /> |

### getNotificationUris

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

```
public List<Uri> getNotificationUris ()
```

Return the URIs at which notifications of changes in this Cursor's data will be delivered, as previously set by[setNotificationUris(ContentResolver, List)](https://developer.android.com/reference/android/database/Cursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>)).

If this is not implemented, this is equivalent to calling[getNotificationUri()](https://developer.android.com/reference/android/database/Cursor#getNotificationUri()).

<br />

|                                                                                                                                                                                                                                         Returns                                                                                                                                                                                                                                          ||
|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[Uri](https://developer.android.com/reference/android/net/Uri)`>` | Returns URIs that can be used with[ContentResolver.registerContentObserver](https://developer.android.com/reference/android/content/ContentResolver#registerContentObserver(android.net.Uri,%20boolean,%20android.database.ContentObserver))to find out about changes to this Cursor's data. May be null if no notification URI has been set. <br /> |

### getPosition

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

```
public int getPosition ()
```

Returns the current position of the cursor in the row set. The value is zero-based. When the row set is first returned the cursor will be at positon -1, which is before the first row. After the last row is returned another call to next() will leave the cursor past the last entry, at a position of count().

<br />

|                              Returns                              ||
|-------|------------------------------------------------------------|
| `int` | the current cursor position. Value is -1 or greater <br /> |

### getShort

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

```
public short getShort (int columnIndex)
```

Returns the value of the requested column as a short.

The result and whether this method throws an exception when the column value is null, the column type is not an integral type, or the integer value is outside the range \[`Short.MIN_VALUE`,`Short.MAX_VALUE`\] is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                       Returns                        ||
|---------|---------------------------------------------|
| `short` | the value of that column as a short. <br /> |

### getString

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

```
public String getString (int columnIndex)
```

Returns the value of the requested column as a String.

The result and whether this method throws an exception when the column value is null or the column type is not a string type is implementation-defined.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                                                     Returns                                                      ||
|--------------------------------------------------------------------|----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the value of that column as a String. <br /> |

### getType

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

```
public int getType (int columnIndex)
```

Returns data type of the given column's value. The preferred type of the column is returned but the data may be converted to other types as documented in the get-type methods such as[getInt(int)](https://developer.android.com/reference/android/database/Cursor#getInt(int)),[getFloat(int)](https://developer.android.com/reference/android/database/Cursor#getFloat(int))etc.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                                                                                                                                                                                                                                                                                Returns                                                                                                                                                                                                                                                                                ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | column value type Value is[FIELD_TYPE_NULL](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_NULL),[FIELD_TYPE_INTEGER](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_INTEGER),[FIELD_TYPE_FLOAT](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_FLOAT),[FIELD_TYPE_STRING](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_STRING), or[FIELD_TYPE_BLOB](https://developer.android.com/reference/android/database/Cursor#FIELD_TYPE_BLOB) <br /> |

### getWantsAllOnMoveCalls

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

```
public boolean getWantsAllOnMoveCalls ()
```

onMove() will only be called across processes if this method returns true.

<br />

|                                      Returns                                       ||
|-----------|-------------------------------------------------------------------------|
| `boolean` | whether all cursor movement should result in a call to onMove(). <br /> |

### isAfterLast

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

```
public boolean isAfterLast ()
```

Returns whether the cursor is pointing to the position after the last row.

<br />

|                            Returns                             ||
|-----------|-----------------------------------------------------|
| `boolean` | whether the cursor is after the last result. <br /> |

### isBeforeFirst

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

```
public boolean isBeforeFirst ()
```

Returns whether the cursor is pointing to the position before the first row.

<br />

|                             Returns                              ||
|-----------|-------------------------------------------------------|
| `boolean` | whether the cursor is before the first result. <br /> |

### isClosed

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

```
public boolean isClosed ()
```

return true if the cursor is closed

<br />

|                     Returns                     ||
|-----------|--------------------------------------|
| `boolean` | true if the cursor is closed. <br /> |

### isFirst

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

```
public boolean isFirst ()
```

Returns whether the cursor is pointing to the first row.

<br />

|                               Returns                                ||
|-----------|-----------------------------------------------------------|
| `boolean` | whether the cursor is pointing at the first entry. <br /> |

### isLast

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

```
public boolean isLast ()
```

Returns whether the cursor is pointing to the last row.

<br />

|                               Returns                               ||
|-----------|----------------------------------------------------------|
| `boolean` | whether the cursor is pointing at the last entry. <br /> |

### isNull

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

```
public boolean isNull (int columnIndex)
```

Returns`true`if the value in the indicated column is null.

<br />

|                                          Parameters                                           ||
|---------------|--------------------------------------------------------------------------------|
| `columnIndex` | `int`: the zero-based index of the target column. Value is 0 or greater <br /> |

|                       Returns                       ||
|-----------|------------------------------------------|
| `boolean` | whether the column value is null. <br /> |

### move

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

```
public boolean move (int offset)
```

Move the cursor by a relative amount, forward or backward, from the current position. Positive offsets move forwards, negative offsets move backwards. If the final position is outside of the bounds of the result set then the resultant position will be pinned to -1 or count() depending on whether the value is off the front or end of the set, respectively.

This method will return true if the requested destination was reachable, otherwise, it returns false. For example, if the cursor is at currently on the second entry in the result set and move(-5) is called, the position will be pinned at -1, and false will be returned.

<br />

|                                 Parameters                                  ||
|----------|-------------------------------------------------------------------|
| `offset` | `int`: the offset to be applied from the current position. <br /> |

|                            Returns                            ||
|-----------|----------------------------------------------------|
| `boolean` | whether the requested move fully succeeded. <br /> |

### moveToFirst

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

```
public boolean moveToFirst ()
```

Move the cursor to the first row.

This method will return false if the cursor is empty.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | whether the move succeeded. <br /> |

### moveToLast

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

```
public boolean moveToLast ()
```

Move the cursor to the last row.

This method will return false if the cursor is empty.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | whether the move succeeded. <br /> |

### moveToNext

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

```
public boolean moveToNext ()
```

Move the cursor to the next row.

This method will return false if the cursor is already past the last entry in the result set.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | whether the move succeeded. <br /> |

### moveToPosition

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

```
public boolean moveToPosition (int position)
```

Move the cursor to an absolute position. The valid range of values is -1 \<= position \<= count.

This method will return true if the request destination was reachable, otherwise, it returns false.

<br />

|                                      Parameters                                      ||
|------------|--------------------------------------------------------------------------|
| `position` | `int`: the zero-based position to move to. Value is -1 or greater <br /> |

|                            Returns                            ||
|-----------|----------------------------------------------------|
| `boolean` | whether the requested move fully succeeded. <br /> |

### moveToPrevious

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

```
public boolean moveToPrevious ()
```

Move the cursor to the previous row.

This method will return false if the cursor is already before the first entry in the result set.

<br />

|                    Returns                    ||
|-----------|------------------------------------|
| `boolean` | whether the move succeeded. <br /> |

### registerContentObserver

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

```
public void registerContentObserver (ContentObserver observer)
```

Register an observer that is called when changes happen to the content backing this cursor. Typically the data set won't change until[requery()](https://developer.android.com/reference/android/database/Cursor#requery())is called.

<br />

|                                                    Parameters                                                    ||
|------------|------------------------------------------------------------------------------------------------------|
| `observer` | `ContentObserver`: the object that gets notified when the content backing the cursor changes. <br /> |

### registerDataSetObserver

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

```
public void registerDataSetObserver (DataSetObserver observer)
```

Register an observer that is called when changes happen to the contents of the this cursors data set, for example, when the data set is changed via[requery()](https://developer.android.com/reference/android/database/Cursor#requery()),[deactivate()](https://developer.android.com/reference/android/database/Cursor#deactivate()), or[close()](https://developer.android.com/reference/android/database/Cursor#close()).

<br />

|                                               Parameters                                               ||
|------------|--------------------------------------------------------------------------------------------|
| `observer` | `DataSetObserver`: the object that gets notified when the cursors data set changes. <br /> |

### requery

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

```
public boolean requery ()
```

Performs the query that created the cursor again, refreshing its contents. This may be done at any time, including after a call to[deactivate()](https://developer.android.com/reference/android/database/Cursor#deactivate()). Since this method could execute a query on the database and potentially take a while, it could cause ANR if it is called on Main (UI) thread. A warning is printed if this method is being executed on Main thread.

<br />

|                                                 Returns                                                  ||
|-----------|-----------------------------------------------------------------------------------------------|
| `boolean` | true if the requery succeeded, false if not, in which case the cursor becomes invalid. <br /> |

### respond

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

```
public Bundle respond (Bundle extras)
```

This is an out-of-band way for the user of a cursor to communicate with the cursor. The structure of each bundle is entirely defined by the cursor.

One use of this is to tell a cursor that it should retry its network request after it reported an error.

<br />

|                                                                Parameters                                                                ||
|----------|--------------------------------------------------------------------------------------------------------------------------------|
| `extras` | `Bundle`: extra values, or[Bundle.EMPTY](https://developer.android.com/reference/android/os/Bundle#EMPTY). Never`null`. <br /> |

|                                                                                          Returns                                                                                          ||
|---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | extra values, or[Bundle.EMPTY](https://developer.android.com/reference/android/os/Bundle#EMPTY). Never`null`. <br /> |

### setExtras

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

```
public void setExtras (Bundle extras)
```

Sets a[Bundle](https://developer.android.com/reference/android/os/Bundle)that will be returned by[getExtras()](https://developer.android.com/reference/android/database/Cursor#getExtras()).

<br />

|                                                              Parameters                                                              ||
|----------|----------------------------------------------------------------------------------------------------------------------------|
| `extras` | `Bundle`:[Bundle](https://developer.android.com/reference/android/os/Bundle)to set, or null to set an empty bundle. <br /> |

### setNotificationUri

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

```
public void setNotificationUri (ContentResolver cr, 
                Uri uri)
```

Register to watch a content URI for changes. This can be the URI of a specific data row (for example, "content://my_provider_type/23"), or a a generic URI for a content type.

Calling this overrides any previous call to[setNotificationUris(android.content.ContentResolver, java.util.List)](https://developer.android.com/reference/android/database/Cursor#setNotificationUris(android.content.ContentResolver,%20java.util.List<android.net.Uri>)).

<br />

|                                                                Parameters                                                                 ||
|-------|------------------------------------------------------------------------------------------------------------------------------------|
| `cr`  | `ContentResolver`: The content resolver from the caller's context. The listener attached to this resolver will be notified. <br /> |
| `uri` | `Uri`: The content URI to watch. <br />                                                                                            |

### setNotificationUris

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

```
public void setNotificationUris (ContentResolver cr, 
                List<Uri> uris)
```

Similar to[setNotificationUri(android.content.ContentResolver, android.net.Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)), except this version allows to watch multiple content URIs for changes.

If this is not implemented, this is equivalent to calling[setNotificationUri(android.content.ContentResolver, android.net.Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri))with the first URI in`uris`.

Calling this overrides any previous call to[setNotificationUri(android.content.ContentResolver, android.net.Uri)](https://developer.android.com/reference/android/database/Cursor#setNotificationUri(android.content.ContentResolver,%20android.net.Uri)).

<br />

|                                                                               Parameters                                                                               ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cr`   | `ContentResolver`: The content resolver from the caller's context. The listener attached to this resolver will be notified. This value cannot be`null`. <br /> |
| `uris` | `List`: The content URIs to watch. This value cannot be`null`. <br />                                                                                          |

### unregisterContentObserver

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

```
public void unregisterContentObserver (ContentObserver observer)
```

Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).

<br />

|                           Parameters                            ||
|------------|-----------------------------------------------------|
| `observer` | `ContentObserver`: the object to unregister. <br /> |

### unregisterDataSetObserver

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

```
public void unregisterDataSetObserver (DataSetObserver observer)
```

Unregister an observer that has previously been registered with this cursor via[registerContentObserver(ContentObserver)](https://developer.android.com/reference/android/database/Cursor#registerContentObserver(android.database.ContentObserver)).

<br />

|                           Parameters                            ||
|------------|-----------------------------------------------------|
| `observer` | `DataSetObserver`: the object to unregister. <br /> |