我正在尝试按照谷歌的例子:
使用他们的 SVN 存储库中的示例文件:
(http)gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/
但是虽然看起来编译导出失败了;有人可以检查一下这不只是我失败了吗?关于是否可以快速修复的任何提示,我在过去 2 小时内一直在用 try/catch 刺激它,但无济于事。
谢谢:o)
忘记添加 它编译并上传到模拟器(和我的手机)但运行它只会导致
The Application WebMapActivity (process com.google.android.examples.webmap) has stopped unexpectedly. Please try again. [Force Close]
最佳答案
将其过滤为
private void setupWebView() {
/*
final String centerURL = "javascript:centerAt("
+ mostRecentLocation.getLatitude() + ","
+ mostRecentLocation.getLongitude() + ")";
webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
// Wait for the page to load then send the location information
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
webView.loadUrl(centerURL);
}
});*/
webView = (WebView) findViewById(R.id.webview);
webView.loadUrl(MAP_URL);
}
多亏了 CommonsWare 的好书,当您知道哪一点不起作用时,过滤掉实际问题会更容易一些,仔细阅读它和实际有效的测试代码可以更容易地找出发生了什么。并感谢调试信息 :o)
关于android - 在 native Android 应用程序中加载 Maps API 站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2349149/