About Cursor
When you understand and use the Android cursor, you must first know a few things about the cursor:
 
 
  
  - The Cursor is a collection of each row.
- Use Movetofirst () to locate the first row.
- You must know the name of each column.
- You must know the data type of each column.
- The Cursor is a random data source.
- All data is obtained by subscript.
important methods for Cursor :
 
 
 
 - Close () Closes the cursor, freeing the resource
- Copystringtobuffer (int columnindex, Chararraybuffer buffer) retrieves the text of the requested column in the buffer, storing it
- getColumnCount () returns the total number of all columns
- Getcolumnindex (String columnName) returns the name of the specified column if there is no return-1
- Getcolumnindexorthrow (String columnName) returns the specified column name from zero, and throws a illegalargumentexception exception if it does not exist.
- getColumnName (int columnindex) returns the column name from the given index
- Getcolumnnames () returns the column name of a string array
- GetCount () returns the number of rows in the cursor
- Movetofirst () Move cursor to first line
- Movetolast () Move the cursor to the last line
- MoveToNext () Move the cursor to the next line
- movetoposition (int position) moves the cursor to an absolute position
- Movetoprevious () Move cursor to previous line
Determine if the cursor is empty
if false ) {// empty cursorreturn;}
Access the Cursor's subscript to get the data
 int Namecolumnindex = cur.getcolumnindex (people.name); String name = cur.getstring (namecolumnindex);     
Now let's see how we loop the Cursor out of the data we need.
 while(Cur.movetonext ()) { // cursor moved successfully // pull data out  }       
When Cur.movetonext () is false, it jumps out of the loop, that is, the Cursor data loop is complete.
If you prefer using a for loop instead of a while loop, you can use the few methods that Google provides:
 
 
  
  - Isbeforefirst () returns whether the cursor points to the position of the previous first row
- Isafterlast () returns whether the cursor points to the position of the last row
- IsClosed () Returns true to indicate that the game has been marked off
With the above method, you can remove the data
 For! cur.isafterlast (); Cur.movetonext ()) {    int namecolumn  = cur.getcolumnindex (People.name);      int phonecolumn = cur.getcolumnindex (People.number);     String  Name = cur.getstring (NameColumn);      string phonenumber =  cur.getstring (Phonecolumn); }
 Done
The cursor class for Android notes