我有一种方法可以显示数据库中的注释标题和日期。但是方法startManagingCursor
已被弃用。有什么方法可以使用 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);
}