Android Color Notification Icon

I’m working on an app where I create a notification for the user. I want the icon to appear as white when it’s in the status bar, but colored blue when it’s being displayed in the drop down notification menu. Here’s an example of the same thing being done by the Google Store app.

White notification in status bar:

enter image description here

Colored notification in drop down menu:

enter image description here

How can I replicate this? What properties do I have to set?

Edit: Here’s my current code – I made the image all white with a transparent background, so it looks fine in the status bar, but in the notification drop, the image is still the same white color:

private NotificationCompat.Builder getNotificationBuilder() {
        return new NotificationCompat.Builder(mainActivity)
                .setColor(ContextCompat.getColor(mainActivity, R.color.colorPrimary))


I found the answer to my question here:

I don’t know entirely what the problem was, but by putting the huge png that I was using for the icon into the this tool and by placing the generated icons it gave into my mipmap folder, I was able to get the setColor(...) property to work correctly.

Leave a Reply

Your email address will not be published. Required fields are marked *