I have a method to display note title and date from a database. However method startManagingCursor
is deprecated. Is there any way I can re-write this using cursor loader ?
private void fillData() {
// Get all of the notes from the database and create the item list
Cursor notesCursor = mDbHelper.fetchAllNotes();
startManagingCursor(notesCursor);
String[] from = new String[] { NotesDbAdapter.KEY_TITLE ,NotesDbAdapter.KEY_DATE};
int[] to = new int[] { R.id.text1 ,R.id.date_row};
// Now create an array adapter and set it to display using our row
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
setListAdapter(notes);
}