Uri 到默认声音通知? [英] Uri to default sound notification?

查看:18
本文介绍了Uri 到默认声音通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Notification.Builder 来构建通知.现在我想使用默认声音通知:

I use the Notification.Builder to build a notification. Now I want to use the default sound notification with:

builder.setSound(Uri sound)

但是默认通知的 Uri 在哪里?

But where is the Uri to the default notification?

推荐答案

尝试使用 RingtoneManager获取默认通知 Uri 为:

try using RingtoneManager to get Default Notification Uri as:

Uri uri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

builder.setSound(uri);

这篇关于Uri 到默认声音通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆