- Home /
How to avoid the white screen before Splashscreen on android mobile.
When I run my app on my device a white screen shows up, then the Unity logo and then my first scene.
Is there a way to prevent the white screen from showing up?
i have this issue both at 5.6.0f3 and 5.6.1f1. On some devices the delay is 12 seconds. Any ideas how to solve it?
Answer by bschizzles · Jul 18, 2017 at 08:44 PM
I was able to fix this by editing the theme in the styles folder in the post-Unity Android project. First I built and exported the project for Unity to be configured for Android Studio. Then I edited the pre-existing styles.xml file in the res/values folders (there are different folders for different styles.xml files according to what I believe are SDK versions) so that the android:windowBackground property for the style was set to my desired color. After building from Android Studio, I had a black background (our desired color) instead of a white background before the Unity logo.
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="UnityThemeSelector" parent="android:Theme.Light.NoTitleBar.Fullscreen"> <item name="android:windowBackground">@color/background</item> </style> </resources>
I also created a colors.xml file in which I created a background color with the corresponding hex value of our desired background color.
Idea came from this post:
http://answers.unity3d.com/questions/936483/set-background-white-to-splash-screen-for-android.html
Answer by HarshadK · Jun 02, 2017 at 11:26 AM
The reason is as specified by Karl Jones on this thread Why is there a delay before the splash screen in Android titles?. Quoting here for convenience:
Do you mean the unity splash screen or the custom android image one? The unity one requires the engine to be loaded so can be delayed if you have a large initial scene. The image is supposed to be shown straight away as its using android specific stuff.
i have this issue at empty project and base initial scene. But white screen have large delay only at first start, then works fine