在我的onCreate中我有一个我想动态设置的布局
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View coachLayout = inflater.inflate(R.layout.coach_content, null);
LinearLayout coachLinear = (LinearLayout) coachLayout.findViewById(R.id.coachLinear);
TextView titleView = (TextView) coachLayout.findViewById(R.id.coachTitle);
updateTitleView(activity, widget, titleView);
我希望将我的View coachlayout传递到setContentView(R.layout.activity_main)
但是setContentView只接受Resource id或int。那么无论如何将我的coachlayout传递给setContentView?
谢谢