问题
I have plotted location and if it has been clicked, it goes to maps and from maps, if it has been clicked direction, it opens google navigation.Is it possible to directly link with navigation?
I have defined the code like this.
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 2nd screenshot and directly
open navigation. how to do this?
My Screenshot are as follows:
回答1:
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));
来源:https://stackoverflow.com/questions/15426611/how-to-open-navigation-instead-of-mapview-in-android