Declare a Cursor

How to Declare a Cursor

Cursor was added in API Level 1

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.

1. Create an Android project, if you don't already have one.

2. In the MainActivity.java file, add the below import.

import android.database.Cursor;

3. After the public class and before the onCreate method, declare the Cursor and name it myCursor.

Cursor myCursor; 

4. Compile and run!

Resources:
http://developer.android.com/reference/android/database/Cursor.html