How to open "google.navigation:q=" in android webview? This URL opens separate Google Maps app but I want it to appear inside my webview so that I can display other information below it.
I am using
In Activity 1:
String urlString="https://www.google" +
".com/maps/dir/?
api=1&destination="+locations.get(position)
+"&travelmode=driving";
Intent mapIntent = new Intent(view.getContext(),
NavigateActivity.class);
mapIntent.putExtra("url", urlString); //Optional parameters
context.startActivity(mapIntent);
In Activity 2:
Bundle extras = getIntent().getExtras();
if (extras != null) {
mapURL = extras.getString("url");
}
WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
if (mapURL != null && !mapURL.isEmpty()) {
webView.loadUrl(mapURL);
}
But it opens simple map app in webview where user has to manually enter the starting destination. I want it to get the current location of the user automatically and prompt for opening GPS if it is not already ON and launch turn by turn navigation in the webview itself.
Is this possible? Please guide.