如何通过android中的代码更改通知声音? [英] How to change notification sound by code in android?

查看:16
本文介绍了如何通过android中的代码更改通知声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何通过 android 中的代码更改通知声音.我已经设法设置了默认铃声,但找不到设置通知音的方法...

Anyone knows how to change notification sound by code in android. I have managed to set the default ringtone, but cant find a way to set the notification tone...

对于任何回复,我将不胜感激,例如代码示例、伪代码或我需要使用的 sdk 部分的名称...

I would be thankful for any response, as code example, psudo code or just name of a which part of the sdk i need to use...

推荐答案

您可以通过 Notification 上的声场.请注意,我没有亲自尝试过,但这是文档所说的.

You can control this on a per-Notification basis via the sound field on Notification. Note that I haven't tried this personally, but it's what the docs say.

这篇关于如何通过android中的代码更改通知声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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