androidandroid-notifications

How to change the text colour of Android Notification


We are using Foreground Service with Notification. A very simple use-case requires us to change the text-colour of the notification's body and title text. After a quick search, I was enlighten with setColor() method of NotificationCompat.Builder.

However, using it only changes the tint colour of the small icon and not the notification title or body text. I also wanted the text 0/7 files have been uploaded and 7 pending to be coloured desirably. This is how it looks currently,

enter image description here

How can I change the text colour of the notification title and body text?


Solution

  • you can't change this, this is system style for Notification, don't have option for setting text color...

    you can introduce your own layout for this purpose, but be aware that across different Android distributions there are different default Notification styles (made by manufacturers) and you won't provide one universal style with only-text-color-changed, which will fit into system styling (same look as other notifications)