Cursor cursor = db.rawQuery("SELECT * FROM contacts", null); // manipulate data cursor.requery(); // refresh cursor with latest data
Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); // manipulate data cursor.requery(); // refresh cursor with latest dataThis example uses the Android ContactsContract API to retrieve all the contacts from the device using a content resolver. After doing some operations on the data, the cursor is refreshed with the latest data by calling the requery() method. The Cursor class is part of the android.database package library.