我想發出通知,點擊它時會將我的應用程序從後臺移到前臺。我使用下面的代碼:當點擊應用程序時發出通知
NotificationManager noma = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
PendingIntent pen = PendingIntent.getActivity(Timer.this, 0, intent, 0);
intent.putExtra("key", "trigerred");
String body = "This is a message";
String title = "This is title";
Notification no = new Notification(R.drawable.ic_launcher, body, System.currentTimeMillis());
no.defaults = Notification.DEFAULT_ALL;
no.setLatestEventInfo(this, title, body, pen);
noma.notify(uniqueID, no);
當我點擊,使一個新的意向通知,但我想帶到前面最後創建的意圖。我怎麼能做到這一點?
的可能重複[點擊通知 - 發送到應用程序(http://stackoverflow.com/questions/3172966/click-notification-send-to-application) – 2012-02-02 14:51:33
郵編哪裏你得到你的意圖對象。 – Natali 2012-02-02 14:52:44
請參閱http://stackoverflow.com/questions/6575730/notification-to-restore-a-task-rather-than-a-specific-activity – 2013-03-19 12:22:35