В моем приложении я хочу показать карту Google с результатом поиска в веб-представлении. например, я хочу найти пиццу в Техасе. Поэтому я хочу показать карту Google с уже найденным результатом для пиццы Техас.
сделайте это
private WebView _webView;
_webView = (WebView)_yourrelativelayourSrc.findViewById(R.id.layout_webview);
_webView.getSettings().setJavaScriptEnabled(true);
_webView.getSettings().setBuiltInZoomControls(true);
_webView.getSettings().setSupportZoom(true);
_webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different scales.
// The progress meter will automatically disappear when we reach 100%
((Activity) activity).setProgress(progress * 1000);
}
});
// to handle its own URL requests :
_webView.setWebViewClient(new MyWebViewClient());
_webView.loadUrl("http://maps.google.com/maps?q=Pizza,texas&ui=maps");
Используйте это:
StringBuilder u = new StringBuilder();
u.append("geo:0,0?q=");
u.append("Pizza, Texas");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(u.toString()));
startActivity(mapIntent);
Или скопируйте ссылку maps.google.com в этот фрагмент, чтобы перейти в браузер:
Intent browseIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( YOUR-URL-HERE ));
startActivity(browseIntent);
закрытый статический окончательный String latitude = "12.292037"; частная статическая окончательная длина строки = "76.641601";
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com/maps?q="+latitude+","+longitude);