0
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TASK);
我登錄到我的應用程序,並打開主頁標誌被打開了多個時間>當我收到通知和preessed它,看在主頁開業以及細節,但以前的
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TASK);
我登錄到我的應用程序,並打開主頁標誌被打開了多個時間>當我收到通知和preessed它,看在主頁開業以及細節,但以前的
您可以用發射方式幫助
去體現您的活動被宣佈實現這一目標。 併爲您的活動聲明添加以下屬性。
機器人:launchMode = 「singleTask」
而在你的活動類ovveride以下方法
public void onNewIntent(Intent intent) {
setIntent(intent);
//do other stuff with new intent
}
我也建議你閱讀更多關於活動的啓動模式https://developer.android.com/guide/topics/manifest/activity-element.html
感謝。它運作良好, –