构建MediaStore URI的特定文件夹 [英] Construct MediaStore URI for specific folder

查看:160
本文介绍了构建MediaStore URI的特定文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果有两个目录 / SD卡/音乐/音乐-1 / SD卡/音乐/音乐-2 如何构建一个URI来得到音乐-1 DIR为例。我可以使用 MediaStore.Audio.Media.EXTERNAL_CONTENT_URI 来获取所有外部存储设备,但是怎么做的伎俩只对特定目录的内容。

For example if a have two directories /sdcard/Music/Music-1 and /sdcard/Music/Music-2 how can I construct a URI to get the files in Music-1 dir for example. I can use MediaStore.Audio.Media.EXTERNAL_CONTENT_URI to get the content of all external storage but how to do the trick only for specific dir.

推荐答案

DATA 字段筛选的路径,构建波普尔 SELECT WHERE 语句相匹配的文件夹名称,您可以使用 SUBSTR 查询; - )

Filter the path from the DATA field and construct a poper SELECT WHERE statement to match the folder names, you can use SUBSTR in the query ;-)

这篇关于构建MediaStore URI的特定文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆