Roy Berris
Roy Berris

Reputation: 1592

Notification icon showing up in status bar but not in notification itself

enter image description here

enter image description here


As you can see, the mipmap icon is showing in the status bar but not in the notification itself. This is how I've set it:

Notification notification = new NotificationCompat.Builder(this).
                setSmallIcon(R.mipmap.ic_launcher). // This is the small icon
                // more code
                build();

Current test device is using Android 7.1.1 Can anyone help or explain why this is happening, or give some advice on how to fix it? Thanks

Upvotes: 0

Views: 1904

Answers (1)

gi097
gi097

Reputation: 7721

This is because Android requires a white icon in the notification bar. So change it to a white icon.

https://developer.android.com/guide/topics/ui/notifiers/notifications.html

What Android basically does, is painting your wall grey. Actually your wall is showing, but with a grey overlay.

According to your question below, you can load your drawable and paint it to white like this:

yourWallIcon.setColorFilter(Color.WHITE)

Note that yourWallIcon must be a drawable.

Upvotes: 1

Related Questions