我试过了,遇到了同样的问题。当我查看控制台输出时,显示了超时错误。不知道为什么。我想你发现了一个错误。
11-08 06:02:27.169: D/CordovaWebView(1420): >>> loadUrl(http://www.johnwargo.com)
11-08 06:02:27.169: D/PluginManager(1420): init()
11-08 06:02:27.189: D/CordovaWebView(1420): >>> loadUrlNow()
11-08 06:02:27.469: D/CordovaActivity(1420): Resuming the App
11-08 06:02:27.579: D/SoftKeyboardDetect(1420): Ignore this event
11-08 06:02:27.879: I/Choreographer(1420): Skipped 82 frames! The application may be doing too much work on its main thread.
11-08 06:02:28.019: D/gralloc_goldfish(1420): Emulator without GPU emulation detected.
11-08 06:02:28.269: D/SoftKeyboardDetect(1420): Ignore this event
11-08 06:02:28.349: I/ActivityManager(378): Displayed com.johnwargo.test/.CordovaApp: +3s376ms
11-08 06:02:28.379: D/AndroidRuntime(1405): Shutting down VM
11-08 06:02:28.399: D/dalvikvm(1405): Debugger has detached; object registry had 1 entries
11-08 06:02:28.689: I/Choreographer(378): Skipped 40 frames! The application may be doing too much work on its main thread.
11-08 06:02:29.519: D/CordovaWebViewClient(1420): onPageStarted(http://www.johnwargo.com/)
11-08 06:02:29.519: D/CordovaActivity(1420): onMessage(onPageStarted,http://www.johnwargo.com/)
11-08 06:02:43.129: D/ConnectivityService(378): Sampling interval elapsed, updating statistics ..
11-08 06:02:43.289: D/ConnectivityService(378): Done.
11-08 06:02:43.289: D/ConnectivityService(378): Setting timer for 720seconds
11-08 06:02:47.229: E/CordovaWebView(1420): CordovaWebView: TIMEOUT ERROR!
11-08 06:02:48.229: W/ProcessCpuTracker(378): Skipping unknown process pid 1484
11-08 06:03:00.489: D/dalvikvm(1420): GC_FOR_ALLOC freed 317K, 10% free 3711K/4108K, paused 265ms, total 266ms
这是一个有效的示例应用程序:
<!DOCTYPE html>
<html>
<head>
<title>Redirect</title>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
function onBodyLoad() {
console.log("body load");
alert("Body Load");
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
console.log("Entering onDeviceReady");
window.open('http://www.johnwargo.com', '_blank');
}
</script>
</head>
<body onload="onBodyLoad()">
<h1>Redirect</h1>
<p>This is a sample Cordova application.</p>
</body>
</html>