如何在构建通知时发出声音无法发出声音?我正在建立通知,而我的用户不喜欢它发出声音的事实。如何在没有声音的情况下显示通知java
我该如何将它改为静音/无声音?
如何显示通知:
android.support.v7.app.NotificationCompat.Builder builder = new android.support.v7.app.NotificationCompat.Builder(main);
builder.setStyle(new android.support.v7.app.NotificationCompat.BigTextStyle().bigText(text));
builder.setSmallIcon(R.drawable.app);
builder.setContentTitle("Rooster Maandag:");
builder.setOngoing(false);
builder.setAutoCancel(true);
builder.setDefaults(Notification.DEFAULT_ALL);
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT);
notificationManager = (NotificationManager) main.getSystemService(main.NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());
我试图在谷歌搜索,但结果只有我得到的是如何发挥的声音,没怎么不播放声音...
编辑 这可能是在一些人眼里的副本,但在我的我找不到出去的有指定的默认选择,而这种新方法被称为setDefaults
可能重复的[Android:通知声音禁用](http://stackoverflow.com/questions/7655164/android-notification-sound-disable) –
@PavneetSingh对不起,没有拿出单词“禁用” – Jason