Black screen for Android application

I added a splash screen for the Android app. It displays, but it shows a black screen for two seconds after showing the splash screen.

How can i fix this?

+4
source share
1 answer

Based on your tags, I assumed that you ran into a problem for the Android Phonegap application.

You need to close the splash screen on the device, and not set a specific time in the loadUrl method.

Code snippet:

super.setIntegerProperty("splashscreen", R.drawable.splash); // Display splash screen for android this.setIntegerProperty("loadUrlTimeoutValue", 70000); super.loadUrl("file:///android_asset/www/index.html",10000);// Give max time here 

Hide screen splash in Phonegap onDeviceReady method:

 document.addEventListener("deviceready", onDeviceReady, false); // Cordova is ready // function onDeviceReady() { cordova.exec(null, null, "SplashScreen", "hide", []) } 
+1
source

Source: https://habr.com/ru/post/1441039/


All Articles