title: Android Notification background color
body: <p>I have a project on Android where I get some notifications. My question is, how can I change the color of the notification? I already have a title and some text. Any ideas?</p>
  
  <pre><code>void setNotification() {
      nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
      nm.cancel(uniqueID);
      Context context = getApplicationContext();
      int icon = R.drawable.notif;// R.drawable.notification_icon;
      CharSequence tickerText = "New Violations";
      long when = System.currentTimeMillis();
  
      CharSequence contentTitle = "New violations";
      CharSequence contentText = "Click to view the violations !";
  
      Notification notification = new Notification(icon, tickerText, when);
      Intent notificationIntent = new Intent(this, NotficationClass.class);
      PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
      notification.flags = Notification.FLAG_AUTO_CANCEL;
      notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
      String ns = Context.NOTIFICATION_SERVICE;
      NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
      mNotificationManager.notify(uniqueID, notification);
  
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/VQYak.png" alt="notification"></p>