为什么我会收到此错误?
(错误:(42,107)错误:不是 抽象并且不会覆盖抽象方法 LoaderCallbacks中的onCreateLoader(int,Bundle)
创建音乐播放器应用时
错误继续出现在Loader中。
private void getAudioListFromMediaDatabase() {
getSupportLoaderManager().initLoader(LOADER_ID, null, new LoaderManager.LoaderCallbacks<Cursor>() {
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
String[] projection = new String[]{
MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.TITLE,
MediaStore.Audio.Media.ARTIST,
MediaStore.Audio.Media.ALBUM,
MediaStore.Audio.Media.ALBUM_ID,
MediaStore.Audio.Media.DURATION,
MediaStore.Audio.Media.DATA
};
String selection = MediaStore.Audio.Media.IS_MUSIC + " = 1";
String sortOrder = MediaStore.Audio.Media.TITLE + " COLLATE LOCALIZED ASC";
return new CursorLoader(getApplicationContext(), uri, projection, selection, null, sortOrder);
}
@Override
public void onLoadFinished(android.support.v4.content.Loader<Cursor> loader, Cursor data) {
}
@Override
public void onLoaderReset(android.support.v4.content.Loader<Cursor> loader) {
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
mAdapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
mAdapter.swapCursor(null);
}
});
}