2011-01-31 65 views

回答

2
  • 使用startActivityForResult而不是startActivity启动Activity3和Activity4。
  • 使用setResult在你的孩子的活动在你的父活动数据返回给前任活动
  • 使用onActivityResult从子活动得到的结果

编辑:新增捆绑的信息。保留原始答案,因为它可能对其他人有用。

既然你实际上并没有开始活动与startActivity,则需要从孩子活动的存储数据,试试这个:

在TabActivity:

// putExtra is overloaded so you can add almost any kind of data. 
// First parameter is the key, second is the value 
getIntent().putExtra ("Result", "OK"); 

在父活动:

// tabAct is the TabActivity object for your tab 
// Here, just specify the key that you used in putExtra in your TabActivity 
String actResult = tabAct.getStringExtra ("Result"); 
if (actResult.equals ("OK") { 
    // Do your actions for success 
} 
else { 
    // Do your actions for failure 
} 
+0

Thnks ..但是你不明确在TabActivity中启动活动.. – dheeps 2011-02-01 03:31:49