When the Activity of your Android app needs to use the Custom drawable background, using the Custom Theme can save the display loading speed of the UI.
Before explaining the cause, you need to clarify the concept:
Window background. Many people think that this background should be the layout background when setContentView is called. In fact, after you call this method, Android will add your View to the window of the corresponding Activity, this window not only contains your View, but also contains a lot of other things, 1.1
Fig 1.1
The View highlighted in blue is a kind of stuff called DecorView. It is the guy who actually holds the window's background drawable! In the current Activity, call getWindow (). setBackgroundDrawable () to modify the Drawable of DecorView.
If you are using the default topic of Android, a default background drawable will be set to your Activity (DecorView's background drawable ). In most cases, this does not affect the performance. However, if you want to set an opaque full screen image as the background image for your Activity, the default background Drawable is redundant, rendering performance may be affected.
You can use the custom Theme to set the android: windowBackground attribute to your own Drawable resource. You can replace the default window background drawable. It is simple and solves performance problems.
Example (From Shelves)
Background Drawable Resource
<Bitmap xmlns: android = "http://schemas.android.com/apk/res/android"
Android: src = "@ drawable/shelf_panel"
Android: tileMode = "repeat"/>
Custom Theme
<Resources>
<Style name = "Theme. Shelves" parent = "android: Theme">
<Item name = "android: windowBackground"> @ drawable/background_shelf </item>
<Item name = "android: windowNoTitle"> true </item>
</Style>
</Resources>
From Xue xianliang's blog