Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set color for app name text in notification (Android)

I am trying to set color for app name text that appears on top of notification. How to change the color to green or blue from grey?

I am looking for something like below, for whatsapp it is green but for my app it is grey

like image 808
Ovais Khan Avatar asked Oct 08 '17 14:10

Ovais Khan


People also ask

How do I change the notification color on my Android?

From the main settings menu, "Notification Theme" allows you to change the background color of your notifications. You can enable a dark theme, light theme, the system default, or choose from a selection of colors.


1 Answers

Just set the color of your notification (as described in https://stackoverflow.com/a/45874836/364388):

NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
...
builder.setColor(ContextCompat.getColor(context, R.color.my_notif_color));    
manager.notify(notificationId, builder.build())
like image 184
Rodja Avatar answered Oct 27 '22 16:10

Rodja