setContentView(R.layout.main);
在MainActivity.java中,默认的显示布局是layout中的main,如果想要改变它的布局,可以new一个对象:
以下是书本上的例子,借用一下====》
FrameLayout frameLayout = new FrameLayout(this);//创建帧布局管理器
frameLayout.setBackground(this.getResources().getDrawable(R.drawable.background));//设置背景,背景为drawable中名为的background图片
setContentView(frameLayout);//设置在Activity中显示framelayout