Get MediaStore path of a Specific Folder

假如想象 提交于 2019-11-29 14:18:28
Daniel Nugent

I just figured it out with help from this answer.

Turns out all you need to do is use this code below to get the cursor, and it will only load images from the /sdcard/comics/ folder.

Note that I tested this with the Ion library and your code, and it worked for me!

mediaCursor = getContentResolver().query(
    MediaStore.Files.getContentUri("external"),
    null,
    MediaStore.Images.Media.DATA + " like ? ",
    new String[] {"%comics%"},
    null
);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!