Fixed Push Notification Icon showing White Android

Credits:

we already know that this is the old problem, actually this is not a problem. This is what we need to do a proper implementation.

Why I’m writing this article is just because I have seen in many applications the push notification icon is showing the white icon when we run this in android 6.0 and greater versions.

always need to be updated on the things according to the OS versions of Android. As we know that Android new OS versions coming rapidly with the new change so we need to change accordingly.

Without wasting the time let’s dig into the implementation, we just need to change the two things.

Implementation of Notification Builder for below and above Lollipop OS version would be:

We just need to change the small icon and color for notification according to the OS versions like below code:

Note:

setColor is only available in Lollipop and it only affect to background of the icon.

now your problem will resolved completely…run and test it.

Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.

If you need any help then Join me on Twitter, Linkedin, Github, and Subscribe to my Youtube Channel.

Senior Software Engineer(Android). Open Source Contributor, Technical Writer, Email: Dani.amjad12@gmail.com check my website at https://danishamjad.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store