Query directory with CursorLoader

你离开我真会死。 提交于 2019-12-04 15:02:22

I managed to pull it off by using an extended clause:

String where = "_data LIKE '/storage/sdcard0/DCIM/%' AND (SELECT LENGTH(_data) - LENGTH(REPLACE(_data, '/', ''))) = 4";

where /storage/sdcard0/DCIM/ is my image directory and 4 is the amount of slashes in the image directory name. I've tried this on a couple different directories (and manually checking them), and it seems to work just fine.

I'll try pskinks method as well (DATA like [dir]/%.jpg and DATA not like [dir]/%/%), and report back the result.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!