In the app's splash page will appear a short black screen or white screen, will bring a very bad user experience, the reason is because the resources have not been loaded to complete the black screen or white screen, and we see the black and white screen is actually the top window, the following summarizes two solutions.
* * Set the window layer interface for our splash interface.
<!--prevent black screen at startup, add window picture-- <style name= "theme.appstartload" parent= "Android:theme" > <item Name= "Android:windowbackground" > @mipmap/start</item> <item name= "Android:windownotitle" > True</item> </style>
Then use the following in the manifest file:
<activity android:name= ". Activity. Launcheractivity " android:screenorientation=" Portrait " android:theme=" @style/ Theme.appstartload
"> <intent-filter> <action android:name=" Android.intent.action.MAIN "/> <category android:name=" Android.intent.category.LAUNCHER "/> </intent-filter> </activity>
The effect is that you can see the splash interface directly when you start. However, it is not possible to set the immersive status bar, and the second method is recommended for students with obsessive-compulsive disorder.
* * Set Window Transparent
<!--prevent black screen from starting, make window background transparent-- <style name= "theme.appstartloadtranslucent" parent= "Android:theme" > <item name= "Android:windowistranslucent" >true</item> <item name= "Android: Windownotitle ">true</item> </style>
The same in the manifest file configuration:
<activity android:name= ". Activity. Launcheractivity " android:screenorientation=" Portrait " android:theme=" @style/ Theme.appstartloadtranslucent " > <intent-filter> <action android:name=" Android.intent.action.MAIN "/> <category android:name=" Android.intent.category.LAUNCHER "/> </intent-filter> </activity>
If you have a better way to welcome the message.
Android launches black screen white screen solution