2015-03-11 3 views

risposta

0

Si può provare Questo.
Ottieni bitmap dell'immagine che desideri impostare come icona per la notifica.

Canvas canvas =  new Canvas(bitmap); 
canvas.drawColor(bgcolor); 

E impostare bitmap al costruttore di notifica.

notificationBuilder.setLargeIcon(bitmap); 
22

penso che è possibile utilizzare il seguente metodo:

  1. Implementare una consuetudine ParsePushBroadcastReceiver
  2. Override getNotification(Context context, Intent intent)
  3. colore Set notifica

Ecco un esempio di come ho fatto io it:

public class PushBroadcastReceiver extends ParsePushBroadcastReceiver { 

    @Override 
    protected Notification getNotification(Context context, Intent intent) { 
     Notification notification = super.getNotification(context, intent); 
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 
      notification.color = context.getResources().getColor(R.color.your_background_color); 
     } 
     return notification; 
    } 
} 
+2

Questo ha funzionato, grazie! –

Problemi correlati