Cannot disable notification vibration in Android 8

前端 未结 5 888
失恋的感觉
失恋的感觉 2021-02-14 18:54

I try to disable vibration when showing a notification.

Func:

public static Notification buildNotifForUploaderService(Context ctx, String          


        
5条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 19:36

    Use NotificationManager.IMPORTANCE_LOW for importance value.

    NotificationChannel notificationChannel = new NotificationChannel(
        CHANNEL_ID,
        CHANNEL_NAME,
        NotificationManager.IMPORTANCE_LOW
    );
    

提交回复
热议问题