Home » Android » Android expanded notofication icon color-Exceptionshub

Android expanded notofication icon color-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I trying to set notification icon color. The icon is added to the project from Asset Studio Clip Art gallery as Notification type icon.

It is applied to notifications like this

val notification = NotificationCompat.Builder(this, channelId)
    .setSmallIcon(R.drawable.ic_stat_mail)
    .setColor(ContextCompat.getColor(context, R.color.yellow))

the color is pure yellow defined in resources

<color name="yellow">#FFFF00</color>

The icon is displayed in the status bar in white color, which is corrrect. But in expanded notification it is displayed in yellow with some black tint.

enter image description here

Why is that black tint added and how can I get rid of it?

Update

The weird thing is that other colors like red (#ff0000) or green (#008000) look ok

enter image description here

How to&Answers: