Notification with gray background?

0

The notifications that generate 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;
...

Why is the background appearing gray?

    
asked by anonymous 30.07.2014 / 16:09

1 answer

1

What happens is that gray is the default color of 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

    
30.07.2014 / 16:25