window.location.reload()导致PhoneGap 1.4/Android Honeycomb 3.2.1上的应用程序错误

joe*_*ker 1 android android-3.0-honeycomb cordova

为什么window.location.reload() === instant_fail在Android 3上?我刚刚获得一个Application Error弹出窗口,其中包含我的应用程序的file:/// ... URL,并且必须重新启动.我试过覆盖DroidGap.onReceivedError()但它只是尝试并且无法重复加载自身.

And*_*ens 6

我不确定你是否仍然需要这个答案,但这可能对某人有所帮助.我在Android 3上运行的PhoneGap遇到了同样的问题.我通过替换此行解决了这个问题:

location.reload(true);
Run Code Online (Sandbox Code Playgroud)

有了这个:

navigator.app.loadUrl('file:///android_asset/www/index.html');
Run Code Online (Sandbox Code Playgroud)