Android ContentResolver 与 USB 记忆棒上的数据
我正在为 Andriod 平板电脑 (3.2) 编写一个应用程序,用于播放存储在 USB 记忆棒上的媒体。但是,我注意到,当 USB 记忆棒未插入时,ContentResolver 返回存储在 USB 记忆棒上的歌曲。有没有办法确保我的内容解析器仅返回实际上可以在文件系统中找到的媒体? IE 停止向我显示当前未插入的 USB 记忆棒上的歌曲?
I am writing an application for an Andriod tablet (3.2) that plays media that in my case is stored on a USB stick. However, I noticed that when the USB stick is NOT plugged in, the ContentResolver returns songs that are stored on the USB stick. Is there a way to make sure my content resolver only returns media that can actually be found in the filesystem? I.E. stop showing me songs on a USB stick that isn't plugged in right now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未找到强制刷新的方法,但看起来 Android 确实会自行定期刷新其数据库。不知道4+如何处理它
I never did find a way to force a refresh, but it looks like Android does refresh its database periodically on its own. Not sure how 4+ handles it