MediaStore.Audio.Media.EXTERNAL_CONTENT_URI 返回空游标
在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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.
此处得到解答
Was answered here