2014-04-01 54 views

回答

0
  1. 您需要在列表視圖中點擊位置名稱。
  2. 然後,您需要獲取緯度和長度以選擇位置名稱,同時獲取當前位置的lat和long。
  3. 然後使用此代碼

代碼:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri .parse("maps.google.com/maps?saddr="; + current_latitude + "," + current_longitude + "&daddr=" + Dest_lat + "," + Dest_long)); 
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); startActivity(intent); 
+0

我試過你的解決方案,但我沒有得到路線..如果有任何這方面的例子,請給我鏈接。 – user2392465

0

有計算器中的一個不錯的答案,它的工作對我來說就像魅力。 請按照此link

即使您可以添加自己的邏輯來存儲自定義ListView中的所有位置,然後獲取從當前位置到地圖上任何其他位置的方向。