当前位置: 首页 > 工具软件 > Black Screen > 使用案例 >

cordova android 黑屏,cordova - Black screen for Android app - Stack Overflow

麻鸿熙
2023-12-01

Based on your tags I assumed that you are facing issue for Android Phonegap app.

You have to close splash screen on device ready instead of giving specific time in 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 splash screen in Phonegap onDeviceReady method :

document.addEventListener("deviceready", onDeviceReady, false);

// Cordova is ready

//

function onDeviceReady() {

cordova.exec(null, null, "SplashScreen", "hide", [])

}

 类似资料: