How to show a notification without a sound java

后端 未结 11 1721
鱼传尺愫
鱼传尺愫 2020-12-11 15:09

How can I make a notification that doesn\'t make a sound when I build it? I am building a notification, and my users don\'t like the fact that it makes a sound.

11条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 15:37

    i had used this piece of code in NotificationCompat.Builder try this,

    NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID);
    builder.setNotificationSilent();
    

提交回复
热议问题