Android8.0关闭通知栏声音

2019-08-29  本文已影响0人  奥巴荣

方法一:降低重要度(修改后需要重装APP或清数据)

NotificationChannel channel = new NotificationChannel(channelID, channelName, NotificationManager.IMPORTANCE_LOW); 

方法二:设置只响一次(重启APP后第一次会响)

builder.setOnlyAlertOnce(true);

方法三:到手机应用通知管理设置铃声为“无”

参考

通知概览 | Android Developers
https://developer.android.google.cn/guide/topics/ui/notifiers/notifications.html

解决android8.0在通知中更新进度条导致连续响铃振动的bug - 掘金
https://juejin.im/post/5a6fe06251882573402685ad

Android 8 通知渠道(Notification Channels) - 掘金
https://juejin.im/post/5b3c376df265da0f6436a1fc

上一篇下一篇

猜你喜欢

热点阅读