android动态加载布局 android如何实现动态添加布局?

android如何实现动态添加布局?代码如下:LinearLayout layout=new LinearLayout(this)textview TX=new textview(this)发送设置文

android如何实现动态添加布局?

代码如下:LinearLayout layout=new LinearLayout(this)textview TX=new textview(this)发送设置文本(“我动态添加了它”)布局.addView(TX)setcontentview(布局)动态添加线性布局并向布局添加文本视图