I'm making one application, notification icon in Lollipop is showing while, for my knowledge I know that Lollipop shows that icon in white color, but I saw that other application is showing icon in colored one. How to do that? I want my icon to be colored in Lollipop. If anyone knows a solution please let me know.
-
2I think you will find the solution here: http://stackoverflow.com/questions/28387602/notification-bar-icon-turns-white-in-android-5-lollipop – Gex Dec 11 '15 at 10:31
-
ya i have gone through the link, but not able to find solution – developer Dec 11 '15 at 12:06
-
ya i have gone through the link but am not able to find solution, please see the image i have displayed above, how they done notification icon in colored one in lollipop – developer Dec 11 '15 at 12:08
-
Please, What is the name of the app? I want to decompile to see the source code. If possible, post the link. Tanks :D – Lucas Feb 09 '17 at 20:59
2 Answers
If you change your targetSdkVersion
in gradle or manifest file below 21, the notification icon will be colorful. (From sdk level 21 there is a white filter on the notification icon.)
Gradle:
android {
defaultConfig {
targetSdkVersion 20
}
}
Manifest:
<uses-sdk
android:targetSdkVersion="20" />

- 2,092
- 19
- 26
If you are using API Level 21 or higher, you should not be using such a notification icon, since it is against Lollipop's Notification design guidelines.
This is how notification icon looks in Lollipop and above
There will be a single icon and you can call setColor() method to set the desired color to the surrounding. In this image which is RED.
But if you are not considering it right now. Then you should lower the targetSdkVersion below 21 in your build.gradle file.
targetSdkVersion 20
So it's not recommended to show the notification icon colored as the one you mentioned.

- 10,335
- 2
- 41
- 41
-
I'm appreciate for your response, i too know that in lollipop notification icons looks white, i have seen that some other application is showing in colored one, how it is possible?? i have mentioned screen short also which taken in lollipop phone – developer Dec 11 '15 at 16:58
-