我在启动画面显示后显示我的 Worklight 主页时遇到问题。 (有关信息,我的应用程序之前运行良好)。
在 res/drawable(s) 文件夹中添加了许多 spashscreen.png 文件后,我更新了 .java 主页类中的 java 代码:
super.setIntegerProperty("splashscreen", R.drawable.splashscreen);
super.loadUrl(getWebMainFilePath(), 5000);
然后我在我的 .html 主页中添加了以下内容:
<script type="text/javascript">
$(document).ready(function(){
// hide splash-screen
navigator.spashscreen.hide();
}
</script>
启动画面显示良好,5 秒后,屏幕变黑。
这是我的 htc 设备的错误日志:
03-08 16:08:08.354: E/libEGL(2722): call to OpenGL ES API with no current context (logged once per thread)
03-08 16:08:08.354: E/SurfaceTexture(1446): [SurfaceView] abandon: surfaceTexture(0x0x9df580) has been abandoned!
03-08 16:08:08.724: E/SurfaceTexture(1446): [Starting com.Maquette] abandon: SurfaceTexture(0x0xa1ca18) has been abandoned!
03-08 16:08:08.744: E/SurfaceTexture(1446): [com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0xa5ce18) has been abandoned!
03-08 16:08:13.068: E/SurfaceTexture(1446): [com.Maquette/com.Maquette.Maquette] abandon: SurfaceTexture(0x0x9df580) has been abandoned!
感谢您的帮助。
最佳答案
您可能想尝试@user2124658 在此线程中给出的答案:Worklight App Splash Screen on Android
如果您使用的是 Worklight 5.0.5.x,请尝试以下操作:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl(getWebMainFilePath()); // yes, this is an extra invocation
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl(getWebMainFilePath(), 5000);
}
如果您使用的是 Worklight 5.0.6.x,请尝试以下操作:
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.bindBrowser(appView);
super.loadUrl(getWebMainFilePath(), 5000);
}
关于android - 启动画面后无法加载 Worklight 应用程序的页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15297330/