I'm trying to use a Notification that also uses the Notification LED on my S3, but for some reason the color will always be blue (I guess it's the default?). I tried to use different colors but nothing changes. Other apps (like Whatsapp, Gmail and Facebook have no problems with showing a different color light).
Notification.Builder noteBuilder = new Notification.Builder(context)
.setAutoCancel(true)
.setPriority(Notification.PRIORITY_DEFAULT)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(ContentTitle)
.setContentText(ContentText)
.setLights(Color.YELLOW, 500, 500)
;
Intent noteIntent = new Intent(context,HoofdScherm.class);
PendingIntent notePendingIntent = PendingIntent.getActivity(context, 0, noteIntent, PendingIntent.FLAG_CANCEL_CURRENT);
noteBuilder.setContentIntent(notePendingIntent);
Notification note = noteBuilder.build();
note.ledARGB = Color.YELLOW;
NotificationManager mgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
mgr.notify(0,note);
Settings > Display > LED indicator. Settings > Sound and notifications > LED indicator.
If the LED indicator behavior does not work as intended, check the LED notification settings. Follow these steps to turn on LED notification: Navigate to Settings > Display & gestures > Notification light. Tap the setting to turn it On.
You need to make sure all the defaults are overridden by setting
notification.defaults = 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With