How to open navigation instead of mapview in android?

I posted the location and, if it was clicked, it goes to the maps and maps, if it was clicked, it opens the Google navigation. Can navigation be referenced directly?

I defined such a code.

GeoPoint pt = item.getPoint(); String lat = Double.toString(pt.getLatitudeE6() / 1e6); String lng = Double.toString(pt.getLongitudeE6() / 1e6); intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + lat + "," + lng)); 

In uri, what should be given to open navigation? I want to skip the 2nd screenshot and directly

open navigation. how to do it?

My screenshot is as follows:

1st screenshot

2nd screenshot here

3rd screenshot

+4
source share
1 answer

However i found a solution

 Intent intent; GeoPoint pt = item.getPoint(); String lat = Double.toString(pt.getLatitudeE6() / 1e6); String lng = Double.toString(pt.getLongitudeE6() / 1e6); intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + lat + "," + lng)); 
+3
source

Source: https://habr.com/ru/post/1469425/


All Articles