1

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.

Right it's look like this.

Thanks in Advance

Kajal
  • 163
  • 2
  • 7

1 Answers1

0

You can customize all your notification UI, This will work for all device. Try these tus:

Thành Hà Văn
  • 481
  • 2
  • 9