4

我已繪製位置,如果它已被點擊,它將轉到地圖和地圖,如果它已被點擊的方向,它會打開谷歌navigation.Is它可以直接鏈接導航?如何在android中打開導航而不是mapview?

我已經定義了這樣的代碼。

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)); 

在uri中,應該給開放導航?我想跳過第二張截圖並直接

打開導航。這個怎麼做?

我的截圖如下:

1st screenshot

2nd screenshot here

3rd screenshot

+0

看一看這個問題 HTTP:/ /stackoverflow.com/questions/5801684/intent-to-start-a-navigation-activity – Neil 2013-03-15 07:12:36

回答

3

不過,我發現了一個解決方案

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)); 
+0

是否有方法可以在mapview中顯示 – Prasad 2015-08-13 08:10:51

相關問題