Hopefully simple java question I've just forgotten or never understood. I've been playing with Loaders in Android 4.0. The program is working as was but now I'm looking to the 'next' part. I want a standard Cursor loader and a custom AsyncTaskLoader. I'm stuck on part 1 trying to convert a cursorLoader to a Loader and return it.
@Override
//public Loader<Cursor> onCreateLoader(int id, Bundle args) {
public Loader<Object> onCreateLoader(int id, Bundle args) {
if (id == LISTVIEWLOADER) {
String[] projection = { RunnerTable.COLUMN_ID,
RunnerTable.COLUMN_NAME };
CursorLoader cursorLoader = new CursorLoader(getActivity(),
FanContentProvider.CONTENT_URI, projection, null, null,
null);
return cursorLoader; //HERE IS THE PROBLEM
}
return null;
}
Type mismatch cannot convert from CursorLoader to Loader.
I believe can make it work with
public class MainFragment extends ListFragment implements
//LoaderManager.LoaderCallbacks<Cursor>
LoaderManager.LoaderCallbacks
But don't like the warning:
LoaderManager.LoaderCallbacks is a raw type. References to generic type LoaderManager.LoaderCallbacks should be parameterized
Thanks for any assistance you can provide.