Solution 1 :
You can customize all your notification UI, This will work for all device. Try these tus:
Problem :
How do i change notification background in android?
I am using androidx.core.app.NotificationCompat
and below code work for Oreo and above Oreo device but not working for below Oreo devices.
builder = new NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentIntent(pendingIntent)
.setShowWhen(false)
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
.setCustomContentView(notificationLayout)
.setColor(ContextCompat.getColor(PlayerEngineService.this, R.color.colorBlack))
.setColorized(true);
I make custom notification View
with black background. But other then notification view notification background is white.
Thanks in Advance
Comments
Comment posted by Kajal
If you check my code notification UI is already custom. but surrounded that UI background color not change
Comment posted by Thành Hà Văn
Just checked again. Look like setColor() and setColorized only works for O and above.
Comment posted by Kajal
Yes that’s why i am looking for something that work for android 6 and 7 as well.