1
我想从特定文件夹中获取mp3文件的列表。MediaStore从特定路径列出
截至目前,我正在使用contentResolver.query从手机获取音乐。
像这样:
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
};
ContentResolver contentResolver = context.getContentResolver();
cursor = contentResolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,projection, selection,null,null);
我要寻找的解决方案只扫描特定文件夹。我如何使用contentResolver来做到这一点?
谢谢!
这个http://stackoverflow.com/questions/20852271/using-contentresolver-and-regex-to-get-音乐从特定的文件夹 –