我用下面的代碼在通知欄中顯示通知。如何在android中添加動態圖像而不是通知圖標?
它工作正常。
但我需要動態顯示來自Web服務的通知圖標。
我該怎麼辦?
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Notification note = new Notification(R.drawable.image,"status message", System.currentTimeMillis());
Intent in = new Intent(Notify.this,CommentU.class);
PendingIntent pi = PendingIntent.getActivity(Notify.this, 0, in, 0);
note.setLatestEventInfo(Notify.this,"NotificationTitle", "You have a new Commentio", pi);
note.number = ++count;
note.vibrate = new long[] { 500l, 200l, 200l, 500l };
note.flags |= Notification.FLAG_AUTO_CANCEL;
nm.notify(NOTIFY_ME_ID, note);
在此先感謝。
看看這個樣本http://code4reference.com/2012/07/android-jelly-bean-notification/ – itsrajesh4uguys