참고 사이트 : http://y-anz-m.blogspot.com/2011/02/android1-activity-activitygroup.html

ActivityGroup 을 통해
Intent 안에 또 Intent을 넣을수 있다.
TabActivity (Activity)
|
|+--- Tab1 (ActivityGroup)
| |
| |+---- 子Activity1 (Activity)
| |
| |+---- 子Activity2 (Activity)
|
|+--- Tab2 (Activity)
|
|+--- Tab3 (Activity)

Host.java
intent = new Intent().setClass(this, MyActivityGroup.class);
spec = tabHost.newTabSpec("tab1")
.setIndicator("Home", res.getDrawable(R.drawable.ic_tab_home))
.setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, Tab2Activity.class);
spec = tabHost
.
.
.
MyActivityGroup.class
public class MyActivityGroup extends ActivityGroup {

LinearLayout container;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.parent);
container = (LinearLayout) findViewById(R.id.child);
}
public void showChild1(View v) {
container.removeAllViews();
Intent intent = new Intent(MyActivityGroup.this, Child1Activity.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Window childActivity = getLocalActivityManager().startActivity("child1Activity",intent);
container.addView(childActivity.getDecorView());
}

public void showChild2(View v) {
container.removeAllViews();
Intent intent = new Intent(MyActivityGroup.this, Child2Activity.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Window childActivity = getLocalActivityManager().startActivity("child2Activity",intent);
container.addView(childActivity.getDecorView());
}
}
Posted by 예배하는 프로그래머