Android での SQLite の使用に関するガイドに従うのに問題があります。(例のように) a のListFragment
代わりに aを使用しているので、代わりに実装しています。次に、 のメソッドで:ListActivity
ListFragment
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>
。
アイデアをありがとう。