Android ContentResolver 与 USB 记忆棒上的数据

发布于 2024-12-27 08:28:33 字数 179 浏览 4 评论 0原文

我正在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮是我掰弯的 2025-01-03 08:28:33

我从未找到强制刷新的方法,但看起来 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文