Views have backgrounds, and each window has a background. Each activity is a window, and each activity has a different background. The drawing order of the interface is as follows: Window--with view--child view. When our view has been covered with the entire window, the program will still draw a transparent window background, which is not visible to the background user. We need to find a way to let the program in this case to remove the window background, save time to draw the window background to improve efficiency.
To delete a window background:
One, in the Java code
public void OnCreate (Bundle icicle) {
Super.oncreate (Icicle);
Setcontentview (R.layout.mainview);
Delete Window background
GetWindow (). setbackgrounddrawable (NULL);
...
}
Second, in the XML file
First, the following is defined in the Res/values/style.xml file:
<resources>
<style name= "Nobackgroundtheme" parent= "Android:theme" >
<item name= "Android:windowbackground" > @null </item>
</style>
</resources>
Then find the activity writing code to remove the background in the Androidmanifest.xml file as follows:
<activity android:name= "MyApplication" android:theme= "@style/nobackgroundtheme" > ... </activity>
android Window background optimization