IBM工作灯5.0.6 - 如何添加一个启动画面到Android环境? [英] IBM Worklight 5.0.6 - How to add a splash screen to Android environment?
本文介绍了IBM工作灯5.0.6 - 如何添加一个启动画面到Android环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我现在面临的一个问题,而试图添加启动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);
}
这篇关于IBM工作灯5.0.6 - 如何添加一个启动画面到Android环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文