想要更新应用的背景:
具体步骤:
1.在xml布局文件中,对最外层的LinearLayout设置id:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@drawable/background1"
android:orientation="vertical" >
2.在activity中添加:
LinearLayout background;
background = (LinearLayout) findViewById(R.id.background);
3.在相应位置(你想更换背景的时候),写上代码:
background.setBackgroundResource(R.drawable.your_pic);