如何在运行时获取铃声偏好?
我有以下 xml:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="Ringtone preference" android:key="ringtone_option_preference">
<RingtonePreference
android:key="ring_tone_pref"
android:title="Set Ringtone Preference"
android:showSilent="true"
android:ringtoneType="notification"
android:summary="Set Ringtone"/>
</PreferenceScreen>
并且我希望每次通知即将显示时,查看铃声的值并相应地发出蜂鸣声:)...更准确地说,我的通知是在 BroadcastReceiver 类中生成的,并且每次接收器捕获到它创建新通知的内容...我只想根据首选项中设置的铃声更改通知的铃声..
我该怎么做?
谢谢迈克
i have the following xml:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="Ringtone preference" android:key="ringtone_option_preference">
<RingtonePreference
android:key="ring_tone_pref"
android:title="Set Ringtone Preference"
android:showSilent="true"
android:ringtoneType="notification"
android:summary="Set Ringtone"/>
</PreferenceScreen>
And i want every time a notification is about to show, to look at the value of the ringtone and beep accordingly :)...To be more precise my notifications are generated in a broadcastReceiver class and each time the receiver catches something it creates a new notification...I just want the ringtone of the notification to change based on the ringtone set in the preferences..
How can I do that?
Thanks
Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没关系,我找到了:
Nevermind I found it:
然后之后
Then After