2012-06-04 26 views
3

我的客戶要求我在兩個位置之間顯示方向。因此他希望我們的應用程序應該啓動android的地圖應用程序並在兩個位置之間顯示方向。我找不到解決這個問題的方法。如何以編程方式在android中啓動地圖應用程序以顯示方向?

因此,任何人都可以告訴我如何以編程方式從我們當前的應用程序啓動地圖應用程序,並顯示Android中兩個位置之間的方向。

請給我任何示例代碼或教程來實現這一點。

+1

你試過嗎? http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android – Zelleriation

+0

我想先推出Phone的地圖應用程序。然後在那裏顯示路線。不可能嗎? –

回答

12

試試這個:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345")); 
startActivity(intent); 
相關問題