作成中のアプリでフォアグラウンドサービスを利用しています。
Android Oreo で通知を出す際、浸食的な表示とバイブレーションが発生してしまうため、それを防止したいです。
通知の処理は以下のように書いており、IMPORTANCE_LOW, enableVibration(false) としているのですが、浸食的な表示とバイブレーションが発生してしまいます。
これらを止めるにはどうすればよいのでしょうか?
Java
1NotificationCompat.Builder builder; 2NotificationManager notifManager = (NotificationManager) myApplication.getSystemService(Context.NOTIFICATION_SERVICE); 3 4// Create Notification Channel 5NotificationChannel mChannel = new NotificationChannel("channelId", "channelName", NotificationManager.IMPORTANCE_LOW); 6mChannel.enableVibration(false); 7notifManager.createNotificationChannel(mChannel); 8 9builder = new NotificationCompat.Builder(myApplicationContext, channelId); 10builder.setContentTitle("title") 11 .setSmallIcon(R.mipmap.ic_launcher_notify) 12 .setContentText("body"); 13Notification notification = builder.build(); 14 15startForeground(10001, notification);
補足情報(FW/ツールのバージョンなど)
Android Studio : 3.1.2
targetSdkVersion 26
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/27 07:43
2018/05/27 11:09