Android8.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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容