Why can't I change the notification background color? I can only change the text color?

Unfortunately, we can no longer change the background color on the notification on Android 5.x and 6.x devices.  As of the 3.3.4 update, we had to update the app to a target SDK of 23 (Target SDK is an integer designating the API Level that the application is targeting. With this attribute set, the application says that while it is able to run on older versions, it was explicitly tested to work with this version), which is Android M. 

Android M (6) has all new permissions, and we had to update the app for those permissions in order to ensure that the app is working correctly as new devices with the newer OS propagate, and Android M is pushed to existing, in-market devices.

Previously, our target SDK was 14 (Android 4.0) so there weren't any changes that effected the app on Android 5 at that SDK level.  But updating to the latest, we now pick up all of the changes that Google made for 5.0 in addition to 6.0.
As part of their 5.0 changes, Google now only allows white icons in the notification bar and dark on white backgrounds.
You can find more information on this here:
"Notifications are drawn with dark text atop white (or very light) backgrounds to match the new material design widgets. Make sure that all your notifications look right with the new color scheme. If your notifications look wrong, fix them:
  • Use setColor() to set an accent color in a circle behind your icon image.
  • Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray."

This is a coding change to the way Google treats Android, so the best we can do is making sure that text isn't white on white or black on black - if we try to change the background color, the system will simply ignore it.


Powered by Zendesk