NotificationChannel为我之前没有声音的通知添加了声音

时间:2017-09-07 01:23:19

标签: android android-notifications android-8.0-oreo

将其添加到我的代码后:

mBuilder.setPriority(NotificationCompat.PRIORITY_LOW)
int importance = NotificationManager.IMPORTANCE_LOW;
notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, importance);
notificationChannel.enableLights(false);
notificationChannel.enableVibration(false);                        
notificationManager.createNotificationChannel(notificationChannel);
mBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);

我之前没有声音的通知现在有声音。在我的通知构建器上,我已将优先级切换为低,因为我读到它可以使它有声音,现在我真的不知道还能做什么。

有什么想法吗?

感谢。

1 个答案:

答案 0 :(得分:1)

一旦创建了频道,它就永远具有重要性。删除频道修复了问题。