Phonegap 2.0 - when the application starts, the white screen blinks until the application loads

How do you get rid of a white screen flash when launching Android and Android applications? It seems to be showing activity_main.xml for a split second, I tried changing the background color to black to make it less noticeable. I guess there is a way to hide this at all?

+3
android cordova
source share
3 answers

The problem is that the WebView must first be created, and by default a blank white page, and then load loadUrl, which loads your application code. One way around this is to show a pop-up window until your application loads in the background.

phonegap - screensaver for Android application

+1
source share

Depending on the theme of your application, you can change the background color of the flash memory, for example: Light or Dark. This minimizes the effect.

0
source share

I also ran into the same problem. I will get around this by setting a background mock activity between init and loadUrl. Thus, I got the whole shell of the process: before the pop-up screen, the splash screen shown, hide the screen saver, and then hide my screen saver after the device is ready.

super.onCreate(savedInstanceState); super.init(); // set the layout background root.setBackgroundDrawable(null); root.setBackgroundResource(R.drawable.splash); root.setBackgroundColor(Color.parseColor("#ffffffff")); super.loadUrl(Config.getStartUrl(), 80000); 

To reduce the code, I installed my splash screen in the config.xml file:

 <preference name="backgroundColor" value="0xffffffff" /> <preference name="splashscreen" value="splash" /> <preference name="AutoHideSplashScreen" value="false" /> <preference name="auto-hide-splash-screen" value="false" /> 

It is based on Cordoba 2.8+. Splash Screen 2.7 is a kind of wack.

Also, if you have a white screen issue on iOS. See the iOS quirk section below: http://docs.phonegap.com/en/2.8.0/cordova_splashscreen_splashscreen.md.html#Splashscreen

0
source share

All Articles