手机的音乐播放器作为闹钟 [英] Phone's music player as Alarm
本文介绍了手机的音乐播放器作为闹钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在做一个涉及警报的应用程序.出于测试目的,我在SD卡n中添加了播放该歌曲的功能.但是我真正想要的是我需要从手机的音乐播放器中选择一首歌曲(用户手机中存在的歌曲列表)并将其设置为闹钟.可能吗?如果可以,我可以获取代码吗?
提前致谢. :)
Hi all,
I am doing an app which involves an alarm. For testing purpose I have added a song in sd card n playing it. But what I really want is I need to select a song from the phone''s music player (song list present in the user''s phone) and set it as alarm clock. Is it possible? If yes can i get the code?
Thanks in advance. :)
推荐答案
当然,您需要做的就是向mediaStore查询所有音乐文件,然后可以在ListView中使用生成的Cursor.
您可能还需要检查MediaStore.Audio.Media.IS_ALARM是否为true,并仅列出这些文件.
很抱歉,但我不编写即席代码,我相信这是足够的信息,可以让您继续前进.
/Darren
Sure it''s possible, all you need to do is query the mediaStore for all music files then you can use the resulting Cursor in a ListView.
You may also want to check MediaStore.Audio.Media.IS_ALARM is true and only list those files.
I''m sorry but I don''t do code adhoc, I''m sure that''s enough information to allow you move forward.
/Darren
这篇关于手机的音乐播放器作为闹钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文