我使用ContentResolver通过将URI传递给ContentResolver的查询方法来从外部内容获取媒体。问题是我要收回所有文件。我如何获得特定文件夹,如“下载”或“音乐”?
ContentResolver musicResolver = getContentResolver();
Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
循环遍历musicCursor对象时,是否应该针对某个环境常量执行if检查,例如Environment.DIRECTORY_MUSIC或Environment.DIRECTORY_DOWNLOADS?