如何获取传入短信的URI当前/默认铃声?
对于默认的通知声音:
String defaultPath = Settings.System.DEFAULT_NOTIFICATION_URI.getPath();
与棉花糖 – 2016-06-21 10:43:19
这里同样不工作,不工作棉花糖起 – sud007 2017-06-05 08:03:35
要检索的默认铃声的Ringtone
对象,请使用RingtoneManager
:
Ringtone ringtone = RingtoneManager.getRingtone(context, Settings.System.DEFAULT_RINGTONE_URI);
如果用户更改默认的铃声中提供铃声第三方应用信使,AFAIK你不能,除非第三方应用程序通过ContentProvider
公开其铃声访问新的铃声。
如果您使用Notification.Builder
或NotificationCompact.Builder
类,则在构建器上调用setSound(Settings.System.DEFAULT_NOTIFICATION_URI)
应该有所斩断。
当系统显示您的通知,将播放默认通知音,用户回升。
,帮助我的人是 RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
。
与棉花糖不工作 – 2016-06-21 10:42:34
这些链接可能会帮助你http://stackoverflow.com/questions/3387556/incoming-call-dynamically-override-default-ringtone http://stackoverflow.com/questions/2092470/android-detect-which-ringtone -is-实际上扮演的铃声,IsPlaying模块-问题?RQ = 1 – 2012-07-25 13:24:06