java.lang.Object | |||
↳ | android.database.AbstractCursor | ||
↳ | android.database.AbstractWindowedCursor | ||
↳ | android.database.sqlite.SQLiteCursor |
A Cursor implementation that exposes results from a query on a
SQLiteDatabase
.
SQLiteCursor is not internally synchronized so code using a SQLiteCursor from multiple
threads should perform its own synchronization when using the SQLiteCursor.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.database.Cursor
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.database.AbstractWindowedCursor
| |||||||||||
From class
android.database.AbstractCursor
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor was deprecated
in API level 11.
use
SQLiteCursor(SQLiteCursorDriver, String, SQLiteQuery) instead
| |||||||||||
Execute a query and provide access to its result set through a Cursor
interface.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the Cursor, releasing all of its resources and making it completely invalid.
| |||||||||||
Deactivates the Cursor, making all calls on it fail until
requery() is called. | |||||||||||
Returns the zero-based index for the given column name, or -1 if the column doesn't exist.
| |||||||||||
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.
| |||||||||||
Returns the numbers of rows in the cursor.
| |||||||||||
Get the database that this cursor is associated with.
| |||||||||||
This function is called every time the cursor is successfully scrolled
to a new position, giving the subclass a chance to update any state it
may have.
| |||||||||||
Performs the query that created the cursor again, refreshing its
contents.
| |||||||||||
Changes the selection arguments.
| |||||||||||
Sets a new cursor window for the cursor to use.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Release the native resources, if they haven't been released yet.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.database.AbstractWindowedCursor
| |||||||||||
From class
android.database.AbstractCursor
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.database.CrossProcessCursor
| |||||||||||
From interface
android.database.Cursor
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
|
This constructor was deprecated
in API level 11.
use SQLiteCursor(SQLiteCursorDriver, String, SQLiteQuery)
instead
Execute a query and provide access to its result set through a Cursor
interface. For a query such as: SELECT name, birth, phone FROM
myTable WHERE ... LIMIT 1,20 ORDER BY...
the column names (name, birth,
phone) would be in the projection argument and everything from
FROM
onward would be in the params argument.
db | a reference to a Database object that is already constructed and opened. This param is not used any longer |
---|---|
editTable | the name of the table used for this query |
query | the rest of the query terms cursor is finalized |
Execute a query and provide access to its result set through a Cursor
interface. For a query such as: SELECT name, birth, phone FROM
myTable WHERE ... LIMIT 1,20 ORDER BY...
the column names (name, birth,
phone) would be in the projection argument and everything from
FROM
onward would be in the params argument.
editTable | the name of the table used for this query |
---|---|
query | the SQLiteQuery object associated with this cursor object.
|
Closes the Cursor, releasing all of its resources and making it completely invalid.
Unlike deactivate()
a call to requery()
will not make the Cursor valid
again.
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(String)
instead, which
will make the error more clear.
columnName | the name of the target column. |
---|
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.
Returns the numbers of rows in the cursor.
Get the database that this cursor is associated with.
This function is called every time the cursor is successfully scrolled to a new position, giving the subclass a chance to update any state it may have. If it returns false the move function will also do so and the cursor will scroll to the beforeFirst position.
oldPosition | the position that we're moving from |
---|---|
newPosition | the position that we're moving to |
Performs the query that created the cursor again, refreshing its
contents. This may be done at any time, including after a call to 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.
Changes the selection arguments. The new values take effect after a call to requery().
Sets a new cursor window for the cursor to use.
The cursor takes ownership of the provided cursor window; the cursor window will be closed when the cursor is closed or when the cursor adopts a new cursor window.
If the cursor previously had a cursor window, then it is closed when the new cursor window is assigned.
window | The new cursor window, typically a remote cursor window. |
---|
Release the native resources, if they haven't been released yet.