恢復的活動我有我的應用程序狀態欄的通知:從通知
Notification notification = new Notification(R.drawable.icon, null, System.currentTimeMillis());
Intent notificationIntent = new Intent(this.parent, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this.parent, 0, notificationIntent, 0);
...
notification.flags = Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(NOTIFICATION_ID, notification);
這樣做的問題是,當你從App按home鍵(它推到後臺)然後按下從狀態欄訪問的列表中的通知,它會啓動活動的全新副本。我想要做的就是恢復應用程序(就像當你長按主頁按鈕並按下應用程序的圖標時)。有沒有創建一個意圖來做到這一點?
檢查:http://stackoverflow.com/questions/3305088/how-to-make-notification-intent-resume-rather-than-making-a- new-intent/39482464#39482464 – TharakaNirmana 2016-09-14 07:52:09