Android Guides | Samples

Android.Database.ICursor

This interface provides random read-write access to the result set returned by a database query.

See Also: ICursor

Syntax

[Android.Runtime.Register("android/database/Cursor", "", "Android.Database.ICursorInvoker")]
public interface ICursor : ICloseable, IDisposable

Remarks

This interface provides random read-write access to the result set returned by a database query.

Cursor implementations are not required to be synchronized so code using a Cursor from multiple threads should perform its own synchronization when using the Cursor.

Implementations should subclass AbstractCursor.

[Android Documentation]

Requirements

Namespace: Android.Database
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Database.ICursor are listed below.

Public Properties

[read-only]
ColumnCountInt32. Return total number of columns
[read-only]
CountInt32. Returns the numbers of rows in the cursor.
[read-only]
ExtrasBundle. Returns a bundle of extra values.
[read-only]
IsAfterLastBoolean. Returns whether the cursor is pointing to the position after the last row.
[read-only]
IsBeforeFirstBoolean. Returns whether the cursor is pointing to the position before the first row.
[read-only]
IsClosedBoolean. return true if the cursor is closed
[read-only]
IsFirstBoolean. Returns whether the cursor is pointing to the first row.
[read-only]
IsLastBoolean. Returns whether the cursor is pointing to the last row.
[read-only]
NotificationUriUri. Return the URI at which notifications of changes in this Cursor's data will be delivered, as previously set by ICursor.SetNotificationUri(ContentResolver,Uri).
[read-only]
PositionInt32. Returns the current position of the cursor in the row set.
[read-only]
WantsAllOnMoveCallsBoolean. onMove() will only be called across processes if this method returns true.

Public Methods

Close()
Closes the Cursor, releasing all of its resources and making it completely invalid.
CopyStringToBuffer(Int32, CharArrayBuffer)
Retrieves the requested column text and stores it in the buffer provided.
Deactivate()
Deactivates the Cursor, making all calls on it fail until ICursor.Requery is called.
GetBlob(Int32) : Byte[]
Returns the value of the requested column as a byte array.
GetColumnIndex(String) : Int32
Returns the zero-based index for the given column name, or -1 if the column doesn't exist.
GetColumnIndexOrThrow(String) : Int32
Returns the zero-based index for the given column name, or throws IllegalArgumentException if the column doesn't exist.
GetColumnName(Int32) : String
Returns the column name at the given zero-based column index.
GetColumnNames() : String[]
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.
GetDouble(Int32) : Double
Returns the value of the requested column as a double.
GetFloat(Int32) : Single
Returns the value of the requested column as a float.
GetInt(Int32) : Int32
Returns the value of the requested column as an int.
GetLong(Int32) : Int64
Returns the value of the requested column as a long.
GetShort(Int32) : Int16
Returns the value of the requested column as a short.
GetString(Int32) : String
Returns the value of the requested column as a String.
GetType(Int32) : FieldType
Returns data type of the given column's value.
IsNull(Int32) : Boolean
Returns true if the value in the indicated column is null.
Move(Int32) : Boolean
Move the cursor by a relative amount, forward or backward, from the current position.
MoveToFirst() : Boolean
Move the cursor to the first row.
MoveToLast() : Boolean
Move the cursor to the last row.
MoveToNext() : Boolean
Move the cursor to the next row.
MoveToPosition(Int32) : Boolean
Move the cursor to an absolute position.
MoveToPrevious() : Boolean
Move the cursor to the previous row.
RegisterContentObserver(ContentObserver)
Register an observer that is called when changes happen to the content backing this cursor.
RegisterDataSetObserver(DataSetObserver)
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 ICursor.Requery, ICursor.Deactivate, or ICursor.Close.
Requery() : Boolean
Performs the query that created the cursor again, refreshing its contents.
Respond(Bundle) : Bundle
This is an out-of-band way for the the user of a cursor to communicate with the cursor.
SetNotificationUri(ContentResolver, Uri)
Register to watch a content URI for changes.
UnregisterContentObserver(ContentObserver)
Unregister an observer that has previously been registered with this cursor via ICursor.RegisterContentObserver(ContentObserver).
UnregisterDataSetObserver(DataSetObserver)
Unregister an observer that has previously been registered with this cursor via ICursor.RegisterContentObserver(ContentObserver).