Android ActivityGroup的使用代码将子activty 的layout加入到主activity中
2010-08-22 04:44:00 来源:WEB开发网核心提示:想代码实现 将子activity的所用的layout加入到主activty中的layoutpublic class FormActivity extends ActivityGroup {@Overrideprotected void onCreate(Bundle savedInstanceState) {super
想代码实现 将子activity的所用的layout加入到主activty中的layout
public class FormActivity extends ActivityGroup {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.form);
LocalActivityManager m = getLocalActivityManager();
Intent intent = new Intent().setClass(this, ContactFieldActivity.class);
Window w = m.startActivity("tratat", intent);
View v = w.getDecorView();
LinearLayout container = (LinearLayout)findViewById(R.id.fieldsContainer);
container.addView(v);
}
}
Tags:Android ActivityGroup 使用
编辑录入:coldstar [复制链接] [打 印][]
更多精彩
赞助商链接