Android:通知声音禁用 [英] Android : Notification sound disable
本文介绍了Android:通知声音禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到一条带有此代码的通知:
I have a notification with this code :
Notification notifica = new Notification();
notifica.flags |= Notification.FLAG_AUTO_CANCEL;
notifica.icon = R.drawable.serie_notification;
notifica.when = System.currentTimeMillis();
with notifica.defaults = notifica.defaults|Notification.DEFAULT_SOUND; 我启用了默认声音,但如果我想禁用声音我该怎么做??
with notifica.defaults = notifica.defaults|Notification.DEFAULT_SOUND; I enable the default sound but if I want to disable the sound how can I do ??
推荐答案
嗯,这样做对我有用:
myNotification.defaults = 0;
试试看 =)
这篇关于Android:通知声音禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文