我创建了一个通知渠道,以在Android 8.0上显示通知,如下所示。
每次我展示通知时,手机都会震动多次。 我通过以下方式禁用了通知渠道的震动功能。
我创建了以下通知:
NotificationChannel uploadChannel = new NotificationChannel(Constants.NOTIFICATION_CHANNEL_UPLOAD_ID,"Uploads", NotificationManager.IMPORTANCE_LOW);
uploadChannel.enableLights(false);
uploadChannel.setDescription("Uploads Channel");
notificationManager.createNotificationChannel(uploadChannel);
每次我展示通知时,手机都会震动多次。 我通过以下方式禁用了通知渠道的震动功能。
uploadChannel.enableVibration(false);
我创建了以下通知:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, Constants.NOTIFICATION_CHANNEL_UPLOAD_ID);
但它并没有起作用,手机在每个通知时都会震动。