我现在面临的一个问题,而试图添加启动screenin的Android。 下面是code我用
I am facing an issue while trying to add a splash screenin Android. Below is the code I used
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.bindBrowser(appView);
super.loadUrl(getWebMainFilePath(), 5000);
}
我看到开机画面,但几分钟后,我得到了一个空白屏幕和应用程序崩溃。
I see the splash image, but then after few minutes I get a blank screen and the app crashes.
在使用工作灯,可以显示onWLInitCompleted方法闪屏和方法保留的onCreate为默认值。 下面就的Nexus 4,的Andriod 4.2.2。code测试
When using Worklight, you can show splash screen in onWLInitCompleted method and leave onCreate method as default. Below code test on Nexus 4, Andriod 4.2.2.
@Override
public void onWLInitCompleted(Bundle savedInstanceState) {
// set splash screen image
super.setIntegerProperty("splashscreen", R.drawable.logo_image);
// Set skin name to skip load skinLoader.html if you have no customized skin.
// This will fix the splash screen flicker on some Android devices when the App first time running.
WLUtils.writeWLPref(getContext(), "wlSkinName", "default");
WLUtils.writeWLPref(getContext(), "exitOnSkinLoader", "true");
// show splash screen 3 seconds
super.loadUrl(getWebMainFilePath(), 3000);
}