startForeground()
need to create NotificationChannel so it will show badge number 1 on Launcher icon in Oreo devices
How can I hide/disable it programmatically?
Because Galaxy S8(Oreo) display badge number 1.
And Android 8.0 emulator also display dot.
This is how I am doing now. But setShowBadge(false)
does not work.
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
NotificationChannel tmpC = new NotificationChannel(id, "basic", NotificationManager.IMPORTANCE_MIN);
tmpC.setShowBadge(false);
manager.createNotificationChannel(tmpC);
Notification notification = new NotificationCompat.Builder(this, id)
.setChannelId(id)
.setAutoCancel(true)
.build();
startForeground(getPackageName().hashCode(), notification);