How to show native google map in webview in android?
Try this:
private String url = "http://maps.google.com/maps";
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.equals("http://maps.google.com/maps")) {
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?" + "saddr=43.0054446,-87.9678884" + "&daddr=42.9257104,-88.0508355"));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
} else {
//else part
}
return true;
}
});
Please check this.It does not open native Google Map app in WebView instead it loads http://maps.google.com/maps?~~ in WebView.
May Help.