Notification with gray background?

Asked

Viewed 111 times

0

The notifications that Gero appear with gray background which makes it difficult to read the news:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
    builder.setTicker("Ticker Texto");
    builder.setContentTitle(" notificação");
    builder.setContentText("Você tem uma nova notícia");
    builder.setSmallIcon(R.drawable.icone);
    builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.icone));
    builder.setContentIntent(p);
    Notification n = builder.build();
    n.vibrate = new long[]{150, 300, 150, 600};
    n.flags = Notification.FLAG_AUTO_CANCEL;
...

because it is appearing gray the background?

  • 1

    Shows a screenshot of what is happening.

  • But what must be happening is the default background is gray.

  • Make a withdrawal here at this link: http://baroqueworksdev.blogspot.com.br/2012/02/custom-notifications-background-color.html

  • Dante changed the SDK to 9, and it worked.

1 answer

1

What happens is that gray is the default color of the NotificationCompat.

You can change the color like this:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
builder.setLights(Color.White, 500, 500);
builder.defaults = 0;

Soen reference

Browser other questions tagged

You are not signed in. Login or sign up in order to post.