2012-02-28 4 views
1

내 응용 프로그램에서 나는 두 개의 geo points.For지도 응용 프로그램을 사용하는 방향을 보여주고 싶습니다. 하지만 그것은 다음과 같은 이미지를 모바일에서 제공하는 다양한 옵션을 보여줍니다. 그러나 나는 이것을 묻지 않고 방향을 보여주고 싶습니다. 그것은 가능한가? 아무도 나를 도와 줄 수 없어.android -지도 응용 프로그램을 직접 여는 방법

String directionweburl = "http://maps.google.com/maps?daddr="+dest_lat+","+dest_long+"&saddr="+source_lat+","+source_long; 

Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(directionweburl)); 

startActivity(myIntent); 

enter image description here

는 처음

업데이트는

enter image description here

를 다음과 같이 보여줍니다하지만 내가 직접이 가능 다음과 같이 표시하려면?

enter image description here

답변

7

당신은 그냥이 http://developer.android.com/guide/appendix/g-app-intents.html을 통해 이동해야합니다.

The Geo URI scheme (not fully supported) is currently under development.을 찾을 수 있습니다. 귀하의 URL 요청을 지원합니다. 따라서 현재 방법은 위도, 경도, 확대/축소 및 쿼리 기능 만 사용하므로 다른 방법을 시도해야한다고 생각합니다.

편집 :이 대화 제거하기 위해 구글지도 활동에 대한 클래스 이름을 설정하는 시도 할 수 있습니다 : (그나마 그 작동하지 않으려 고) 이 클래스 이름을 설정하십시오

String directionweburl = "http://maps.google.com/maps?daddr="+dest_lat+","+dest_long+"&saddr="+source_lat+","+source_long; 

Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(directionweburl)); 
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); 
startActivity(myIntent); 

편집 2을 :

intent.setClassName("com.google.android.apps.maps", 
"com.google.android.maps.driveabout.app.NavigationActivity"); 
+0

감사합니다. – naresh

+0

게시물을 업데이트했습니다. 일단 게시물을 참조하십시오. – naresh

+0

try intent.setClassName ("com.google.android.apps.m4ps", "com.google.android.maps.driveabout.app.NavigationActivity"); –

0

문자열 directionweburl = "http://maps.google.com/maps?daddr="+dest_lat+","+dest_long+"& saddr 항목 = "+ source_lat + ","+ source_long;

의도 myIntent = 새로운 의도 (Intent.ACTION_VIEW, Uri.parse (directionweburl)); intent.setClassName ("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); startActivity (myIntent);

의 문제는 사용 구글 API를 시뮬레이터에게 발생하는 경우 작업

0

문자열 directionweburl = "http://maps.google.com/maps?daddr="+dest_lat+","+dest_long+"& saddr 항목 = " + source_lat + ","+ source_long;

의도 myIntent = 새로운 의도 (Intent.ACTION_VIEW, Uri.parse (directionweburl)); intent.setClassName ("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); startActivity (myIntent);

관련 문제