MediaStore.Audio.Media.EXTERNAL_CONTENT_URI 返回空游标

发布于 2024-10-14 15:27:50 字数 682 浏览 3 评论 0原文

在android中我无法弄清楚为什么这个光标在htc野火中是空的。但适用于所有其他手机 SD卡上有几个音频文件。 库存媒体播放器可以找到并播放这些歌曲。

Cursor c = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { "distinct " + MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.ALBUM_ID}, 
                null,
                null, 
                MediaStore.Audio.Media.ARTIST);

如果有人能够在野火上成功查询 mediastore.audio.media,请告诉我。

更新:显然它只在这台设备上。其他野火工作正常。仍然看起来很奇怪的是,漫步的图书播放器(我猜他们只是循环遍历文件夹并进行自己的 id3 解析)和库存 Android 音乐播放器都找到了音乐,但我无法从媒体商店获取任何内容。不存在“.nomedia”文件,我尝试将新的 mp3 文件插入新文件夹。

是否没有人经历过这种行为,不一定是野火,只是任何 Android 设备。

In android I can't figure out why this cursor is empty in htc wildfire. but works on all other phones
there are several audiofiles on the sdcard.
the stock mediaplayer can find and play these songs alright.

Cursor c = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { "distinct " + MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.ALBUM_ID}, 
                null,
                null, 
                MediaStore.Audio.Media.ARTIST);

If there is anyone out there that has been able to successfully query the mediastore.audio.media on a wildfire, please let me know.

Update: Apperantly it's just on this single device. Other wildfire's work fine. Still it seems strange that both the ambling book player (I'm guessing they just loop through the folders and do their own id3 parsing) and the stock android music player find the music but I can't get anything from the mediastore. No ".nomedia" files are present, I have tried inserting new mp3 files to a new folder.

Is there no one out there that has experienced this behaviour with, not necessarily a wildfire, just any android device.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

似狗非友 2024-10-21 15:27:50

HTC 以使用 Intent 模式而闻名。 Google 尚未锁定 所有类型的兼容性文档。我猜这就是这里发生的事情。您需要找到 HTC 将 MediaStore Intent 模式更改为的内容并对其进行修复。

HTC is known for screwing with the Intent patterns. Google hasn't locked down the requirements given in the Compatibility Document for all types. My guess is that is what is going on here. You'll need to find what HTC changed the MediaStore Intent patterns to and implement a fix for it.

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