private LinearLayout activity_view = null;
// 获得一个可扩展的layout实例
private LayoutInflater inflater = null;
activity_view = (LinearLayout) findViewById(R.id.activity_view);
inflater = (LayoutInflater) MainActivity.this
.getSystemService(LAYOUT_INFLATER_SERVICE);
// 将layout添加到view
View view = inflater.inflate(mLayout, null);
activity_view.addView(view);