У меня есть способ отображения названия и даты заметки из базы данных. Однако метод startManagingCursor
устарел. Есть ли способ переписать его с помощью загрузчика курсора?переписывание метода использования курсора 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);
}
Вы посмотрели http://stackoverflow.com/questions/10145735/how-to-properly-transition-from-startmanagingcursor-to-cursorloader – aquaraga