2014-09-19 46 views
0

我正在使用ParsePush向我的Android用戶發送通知。我想定製出現在操作欄中的通知圖標。如何自定義推送通知圖標?

當前正在顯示應用啓動器圖標。但是我想改變它併爲通知使用不同的圖標。

+0

的可能重複[Android的 - 更改通知圖標](http://stackoverflow.com/questions/11379518/android-change-notification-icon) – Shane 2014-09-19 03:59:54

+0

NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder( \t \t \t \t上下文).setSmallIcon(R.drawable.applogo) – 2014-09-19 04:37:42

+0

我詢問有關使用ParsePush @Shane更改圖標的問題 – 2014-09-19 12:10:38

回答

1

這是使用重載函數解決

setDefaultPushCallback(Context context, Class<? extends Activity> cls, int icon) 
0

試試這個..

NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(@android:drawable/btn_star) 
0
NotificationCompat.Builder builder = new NotificationCompat.Builder(context) 
      .setContentTitle(notificationTitle) 
      .setContentText(notificationMessage) 
      .setSmallIcon(R.drawable.YOUR_IMAGE) 
      .setContentIntent(resultPendingIntent) 
      .setAutoCancel(true) 
      .setStyle(bigStyle); 

    NotificationManager notificationmanager = (NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE); 
    notificationmanager.notify(nofy_id, builder.build());