gpt4 book ai didi

java - 禁用 Android 中的通知声音

转载 作者:行者123 更新时间:2023-12-01 08:54:07 24 4
gpt4 key购买 nike

我想创建一个没有任何声音的通知。我该怎么做?谢谢。

这是我的代码:Link

对不起, friend 们。我无法将我的代码放在这里。

非常感谢。

最佳答案

我真的不明白你的问题,但简单来说..这是在android中创建通知的代码:

Notification notifica = new Notification();
notifica.flags |= Notification.FLAG_AUTO_CANCEL;
notifica.icon = R.drawable.serie_notification;
notifica.when = System.currentTimeMillis();

要禁用声音,您必须添加以下内容:

notifica.defaults = 0;

关于java - 禁用 Android 中的通知声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42174892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com