Cannot disable notification vibration in Android 8

前端 未结 5 900
失恋的感觉
失恋的感觉 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:39

    The answer of Ahmadul Hoq which can be found here might be helpful.

    Basically you have to enable vibration and set the vibration pattern to 0L. There seems to be a bug on Android Oreo which causes this workaround.

    EDIT:

    If you are using summary notification this might cause the double vibration. I had the same behaviour until I found out that the summary notification which was grouped together with the incoming notification was causing this issue. You can create an extra notification channel for the summary notification and set the importance for this one to "low". This means the channel for the summary notification will be silent and you should only have sound and vibration coming from the normal incoming notifications.

提交回复
热议问题