It is believed that most people start with a white or black screen before starting the app and then entering the first interface, for example: Splashactivity. Then what is the cause of it?
<style name= "Splash_theme" parent= "@android: Style/theme.notitlebar" >
</style>
The reason is that we have to change the theme of activity/application set cause, because the theme of the corresponding Windowbackground and other backgrounds are set to white or black, And when we enter the first interface of the app, we don't execute oncreate right away, so it screen or black screen before entering the interface.
So I tried to search for a delayed start to solve the problem. But the egg, after I decompile the micro-letter and so some of the not-so-effective app view their theme settings, and found the solution:
1. Setting up a background similar to the background of the startup page, if your startup page is a picture then you can set the picture directly to windowbackground this property so there's no flash effect.
<!--setting Theme background-->
<style name= "Splash_theme" parent= "@android: Style/theme.notitlebar" >
< Item Name= "Android:windowbackground" > @drawable/splash_bg</item>
<item name= "Android: Windownotitle ">true</item>
</style>
2. The use of the way of the environment, set the background is transparent, give a person a sense of delayed start.
<style name= "Splash_theme" parent= "@android: Style/theme.notitlebar" >
<item name= "Android: Windowistranslucent ">true</item>
<item name=" Android:windownotitle ">true</item>
</style>
Take this setting so that we can solve this flash problem and make our application experience a little more perfect.
The above is a small set of Android to introduce the use of theme to solve the launch of the app when the blank screen problem, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!