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

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

问题描述

任何人都知道如何code改变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...

我会感谢任何回应,因为code为例,psudo code或A,我需要使用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...

推荐答案

您可以在每个控制这一点 - 通过的通知基础=HTTP:/ /developer.android.com/reference/android/app/Notification.html#sound相对=nofollow>音场的通知 。请注意,我没有尝试过这种个人,但它就是文档说。

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.

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

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