Android Color Notification Icon –

January 8, 2021 by No Comments

Development issue/problem:

I’m working on an application in which I make a notification for the user. I want the icon to appear in white when it is in the status bar, but in blue when it appears in the notification drop-down menu. Here is an example of the same with the Google Store application.

The message is white in the status bar:

Color message in the drop-down menu :

How can I do it again? Which properties do I need to repair?

Here is my current code – I’ve made the image completely white with a transparent background, so it looks good in the status bar, but the image remains the same white color as the notifications:

private NotificationCompat.Builder getNotificationBuilder() {get a new NotificationCompat.Builder(mainActivity).setDeleteIntent(deletedPendingIntent).setContent(startChatPendingIntent).setAutoCancel(true).setSmallIcon(R.drawable.skylight_notification).setColor(ContextCompatible.getColor(mainActivity, R.color.colorPrimary)).setContentTitle(mainActivity.getString(R.string.notification_title)).setContentText(mainActivity.getString(R.string.notification_prompt));}.

How can I solve this problem?

Solution 1:

I found the answer to my question here:

I don’t know exactly what the problem was, but by putting the large png I used for the icon in this tool
and placing the generated icons in my mipmap folder, I was able to make the setColor(…) property work correctly.

Solution 2:

For Firebase notifications sent from the console, simply add them to your :

Where white_logo is the white logo of your application and custom_color is the color you want to use to color the icon and text white.

More information can be found here:

Solution 3:

This is what I did for my app….

private void showNotification(Context) {
Log.d(MainActivity.APP_TAG, Displaying Notification);
Intent = new Intent(context, MainActivity.class);
PendingIntent = PendingIntent.getActivity(context, 0, activityIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
mBuilder.setContentIntent (pending deIntent);
mBuilder.setContentTitle (EarthQuakeAlert);
mBuilder.setContentText (long time no verification of seismic data!);
mBuilder.setDefaults (Notification.DEFAULT_SOUND);
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

Colour swatches :

Colourless patterns :

Solution 4:

You can set the color and icon when creating an alert. If your icon is a pure white image, it will be colored in the right places.

fall manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
fall notificationId = 10 // A unique identifier.

// Channel creation – mandatory for notifications O.
fall channel = NotificationChannel (my_channel_01,
Channel human readable title,


// Build notification.fall builder = Notification.builder(context,!)builder.setContentText(This is a bad notification!)builder.setSmallIcon(R.drawable.skull)builder.setColor(ContextCompatible.getColor(context, R.color.colorPrimary))builder.setChannelId(

// Send the notification.

Solution No 5:

If you want to change the color and name of the header in a push notification or a built-in notification in order to adapt it to Gmail and Twitter, you need to add these lines to the notification.

builder.setColor(ContextCompatible.getColor(context, R.colorPrimary))

The first line is used for the symbol and the second line should define the color

Solution No 6:

You can use DrawableCompat.setTint(int drawable); to draw before setting the drawable.
And make the mutation() drawable, otherwise a colour shadow will be applied to each copy of the drawing.

Solution No 7:

Create a notification icon using the Asset Studio available in Android Studio itself (right-click the res folder and select New > Picture Assets).

New Android Studio Image Menu

Then set the colour of the message

int color = Color.argb(255, 228, 14, 18) ;

NotificationCompat.Builder notificationBuilder =
new NotificationCompatible.Builder(this, channelId)

Good luck!

Related Tags:

notification icon showing white android,notification color code,what is batch management in android,notificationcolorutil,how to make notification panel black,android notification setcolor not working,android notification icon generator,list of app notification icons,android notification icon is grey,react-native-firebase notification icon,notification icon not showing android oreo,android notification large icon not showing,notification android,android notification styles,push notification in android using firebase,how to turn on notifications on android phone,change notification light color android,change lock screen notification color,blur notification panel android,notification bar changer root,how to change notification bar color huawei,notification icon generator android,android notification small icon is grey,notification icon not showing android nougat,how to set push notification icon in android,push notification icon size,hms core,android app notification icons,android notification icon guidelines,change notification background color android,change notification text color android

Leave a Comment

Your email address will not be published. Required fields are marked *