У меня возникли проблемы с использованием руководства по использованию SQLite в Android. Я использую ListFragment вместо ListActivity (как в примере), поэтому вместо ListFragment LoaderManager.LoaderCallbacks<Cursor> используется LoaderManager.LoaderCallbacks<Cursor>. Затем в методе fillData() в ListFragment:
private void fillData() {
// Fields from the database (projection)
// Must include the _id column for the adapter to work
String[] from = new String[] { NotesSQLiteHelper.COLUMN_TITLE };
// Fields on the UI to which we map
int[] to = new int[] { R.id.label };
getLoaderManager().initLoader(0, null, this); //error
adapter = new SimpleCursorAdapter(getApplicationContext(), R.layout.notes_row, null, from, to, 0);
setListAdapter(adapter);
}
Я получаю сообщение об ошибке:
The method initLoader(int, Bundle, LoaderManager.LoaderCallbacks<D>) in the type LoaderManager is not applicable for the arguments (int, null, NotesActivity.ArrayListFragment)
на отмеченной строке, хотя this реализует LoaderManager.LoaderCallbacks<Cursor>.
Спасибо за любые идеи.