我现在正在开发一个简单的音乐播放器,我需要获取所有音频文件的缩略图。
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";
String[] projection = {
MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.ARTIST,
MediaStore.Audio.Media.TITLE,
MediaStore.Audio.Media.DATA,
MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Media.DURATION,
MediaStore.Audio.Media.YEAR
};
cursor = getBaseContext().getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
projection, selection, null, null);
while(cursor.moveToNext()) {
name.add(cursor.getString(4));
path.add(cursor.getString(3));
duration.add(cursor.getString(5));
}
我怎么才能得到它 ?提前致谢。