ActivityGroup的使用代码将子activty 的layout加入到主activity中

想代码实现 将子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); 
 
} 
 
 
} 

你可能感兴趣的:(ActivityGroup)