I'm having trouble following a guide(
http://www.vogella.com/articles/AndroidSQLite/article.html) on using SQLite
in Android. I'm using a ListFragment instead of a ListActivity(as in the
example), so I have the ListFragment implement
LoaderManager.LoaderCallbacks<Cursor> instead. Then, in the fillData() method
in the 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);
}
I get the error:
The method initLoader(int, Bundle, LoaderManager.LoaderCallbacks<D>) in
the type LoaderManager is not applicable for the arguments (int, null,
NotesActivity.ArrayListFragment)
on the marked line even though this implements
LoaderManager.LoaderCallbacks<Cursor>.
Thank you for any ideas.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en