Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change notification background color in android?

Tags:

android

how do I change notification color in android? I tried this code but it only changed the title and icon color.

NotificationCompat.Builder(mContext,NOTIFICATION_CHANNEL_ID).setColorized(true).setColor(Color.parseColor("#f7da64")

enter image description here

like image 833
yigitserin Avatar asked May 09 '18 11:05

yigitserin


1 Answers

  1. Make sure the Theme/Color used is consistent in

    • application tag of manifest file
    • all style files (style.xml,style.xml(v21))
  2. Make sure in notificationBuilder.setColor(mNotificationColor) , mNotificationColor is really pointing to the expected color code.

  3. Check if you are setting meidastyle as shown below

    .setStyle(new MediaStyle() .setShowActionsInCompactView( new int[]{playPauseButtonPosition})in compact view .setMediaSession(mSessionToken))

like image 147
Bruce Avatar answered Oct 05 '22 17:10

Bruce