我在我的phonegap应用程序中实现了jquery.min.js,但它显示了CordovaWebView超时错误。我也试过
super.setIntegerProperty("loadUrlTimeoutValue", 10000);但是它只是在花时间,在那之后,同样的"CordovaWebView:超时错误!“就要来了。请给我提供适当的解决方案。
发布于 2013-06-10 22:17:25
我猜你的主脚本太长了,不能执行:
//code executed after the loading of the page (if your using jquery)
$(function() {
//if this method is too heavy and takes too long to execute, it will trigger the TIMEOUT ERROR.
doSomeStuff();
});我可能不想在这个方法上添加一个超时,以便让应用程序启动,然后启动你的繁重脚本(你可能想要显示一个加载图像或类似的东西)。
代码片段:
//code executed after the loading of the page
$(function() {
//in mobile environment, this timeout leaves time for the app to launch before we start any heavy process.
setTimeout(function(){
doSomeStuff();
},100);
});发布于 2013-03-31 03:02:33
您可以增加超时值,请参阅此link
super.setIntegerProperty("loadUrlTimeoutValue", 60000); 更新
在示例中,我用下面的代码片段替换了我的旧代码,它可以工作:
我添加了import org.apache.cordova.*,并将super.loadUrl(Config.getStartUrl())代替了url方法
import org.apache.cordova.*;
import android.os.Bundle;
public class MyApp extends DroidGap
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl(Config.getStartUrl());
}发布于 2013-08-01 17:51:22
从相同的AVD重启应用程序将会解决这个问题,不需要给应用程序一个'run as‘命令,只需从手机或AVD中选择应用程序,然后再次运行它可能是因为你的设备非常慢,并且没有对你指定的值识别变量做出快速响应
我-
https://stackoverflow.com/questions/14505204
复制相似问题