2014-09-05 77 views
0

在我的項目中,我有3個活動,A-> B - > C.在C活動中它有訂單按鈕,點擊訂單按鈕後我還必須通過一個包來打算一項活動,我希望A活動再次展示。我怎麼能再次顯示A活動?如何從新活動中調用上一個活動

感謝,

+0

你可以關閉你的Front Activities,或者使用Fragments。 – SilentKiller 2014-09-05 05:23:44

+0

[Use onactivityresult android]可能的重複(http://stackoverflow.com/questions/20114485/use-onactivityresult-android) – Nabin 2014-09-05 05:26:00

+0

看到這個http://stackoverflow.com/questions/10407159/how-to-manage-start -activity-for-result-on-android – Nabin 2014-09-05 05:26:44

回答

0

取決於你的需求,如果你想完成activty B和C 上按鈕單擊然後使用標誌FLAG_ACTIVITY_CLEAR_TOP意圖 標誌。在這種情況下,將調用newIntent,你可以從它得到包 。

@Override 
    protected void onNewIntent(Intent intent) { 
     // TODO Auto-generated method stub 
     super.onNewIntent(intent); 
    } 

if you do not wants to close activity B and C then use 

Intent intent = new Intent(this, YourActivity.class); 
Bundle bundle = new Bundle(); 
intent.putextras(bundle); 
startActivity(intent); 

如有問題,然後讓我知道。

+0

Intent i = new Intent(mContext,MainActivity.class); \t \t \t i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); \t \t \t startActivity(i);我之前使用這行代碼來調用MainActivity.java,沒關係,MainActivity.java中的片段沒有顯示錶單統計數據,例如用戶選擇的微調器項目和用戶輸入的edittext數據。 – SAWAUNG 2014-09-05 10:44:18