I am trying to set color for app name text that appears on top of notification. How to change the color to green or blue from grey?
Asked
Active
Viewed 4,345 times
6
-
try using customView notification – Ankit Aman Oct 08 '17 at 23:35
2 Answers
7
Just set the color of your notification (as described in https://stackoverflow.com/a/45874836/364388):
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
...
builder.setColor(ContextCompat.getColor(context, R.color.my_notif_color));
manager.notify(notificationId, builder.build())

Rodja
- 7,998
- 8
- 48
- 55
-
13this is working for notification small icon but not for the app name. – Ajay Naredla Jan 21 '20 at 06:58
-1
Find TextView by its it and use SetTextColor method to set the color. ex. as following.
var builder = new AlertDialog.Builder (this);
var dialog = builder.Show();
int textColorId = Resources.GetIdentifier ("alertTitle", "id", "android");
TextView textColor = dialog.FindViewById<TextView> (textColorId);
textColor?.SetTextColor (Color.DarkRed);

Sunny
- 1,504
- 14
- 22