By default, when the activity starts to brush the screen into white or black, and then draw the interface, draw the interface more or less a little delay, this time you see is white screen, obviously affect the user experience, how to eliminate it?
Set style in Activity theme
<style name= "Apptheme" parent= "Android:Theme.Light.NoTitleBar" > <item name= "Android: Windowistranslucent ">true</item> <item name=" Android:windownotitle ">true</item> <item name= "Android:windowactionbar" >false</item> <item name= "Android:windowbackground" >@ Android:color/transparent</item> <!--All customizations that is not specific to a particular api-level can Go here. - </style>
it means to keep the window in a transparent state .
Since OnCreate () sometimes loads too much data, causing the interface to be too late to display, after changing the theme, the program background will be transparent, showing the interface of the previous program until the loading is complete
Note: Set a background for your layout layouts, or you can see the desktop when you are finished loading!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Perfect solution startup, switch between activity, black screen problem