Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – how to change notification background color in nougat?

Posted on November 11, 2022 By

Solution 1 :

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

  • This one
  • Android guide

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.

Right it’s look like this.

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.

READ  [FIXED] How to configure Web Page Kiosk with Android Management API
Powered by Inline Related Posts
Android Tags:android, android-7.0-nougat, android-notification.mediastyle, android-notifications, notifications

Post navigation

Previous Post: [FIXED] android – How to pass data by Back Button, Kotlin
Next Post: [FIXED] Project with external module issue in android studio 3.6

Related Posts

[FIXED] android – Want to create an app in which it shows 3 button vertically and horizontally at the center but when I have tried only the 3rd button was there , Android
[FIXED] firebase – Automate download of google-services.json for Android Android
[FIXED] How to release an App in the Google Play store without the Android App Bundle feature Android
[FIXED] Admin Panel In Mobile Apps || How to Add and hide from local user || React native || Android Android
[FIXED] android – Run Coroutine functions on broadcast receiver Android
[FIXED] java – Trying To Get Key From a Child Value In Firebase Database Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can VPN be traced by police?
  • Where were Kaiser-Frazer cars built?
  • How do you make gold rose gold paint?
  • What are the newest type of dentures?
  • Can you wear joggers as dress pants?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme