I have this code:
Notification notif; // Build notification Notification.Builder notifBuilder = new Notification.Builder(context); notifBuilder.setContentIntent(pendingIntent); notifBuilder.setContentTitle(title); notifBuilder.setSmallIcon(icon_resId); notifBuilder.setContentText(ne.getCaption()); notifBuilder.setDefaults(Notification.DEFAULT_ALL); notifBuilder.setAutoCancel(autocancel); notifBuilder.setWhen(System.currentTimeMillis()); notif = notifBuilder.build();
and works fine in Android 4.4.
However, in Android 5.0 the icon showed in status bar is a white square. The icon showed in the new "notification body", that appears when device is locked, is correct.
In http://developer.android.com/reference/android/app/Notification.Builder.html, I don't see anything new about notification icons in API Level 21
1 Tap Notification Settings on the notification panel or tap the Settings app. 2 Tap Notifications. 3 Tap App icon badges.
Android Status Bar icons are notifications in the graphical user interface (GUI) from apps running on your device. These notifications can contain text, graphics, and even controls.
Look at the documentation: http://developer.android.com/design/style/iconography.html
there are words: "Notification icons must be entirely white. Also, the system may scale down and/or darken the icons."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With