我想打开inbuilt google map intent
来显示两个地方之间的路线而不打开complete action dialog, which asked for Browser and Map
。
我试过了。
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+PreferenceData.getLatitude(HotelInfomation.this)+","+PreferenceData.getLongitude(HotelInfomation.this)+"&daddr="+latitude+","+longitude));
startActivity(intent);
但它会打开一个对话框,询问使用浏览器或地图完成操作。我不想要那个Dialog。
答案 0 :(得分:4)
without open a complete action dialog, which asked for Browser and Map
在这种情况下,您需要告诉android您要使用哪个应用程序来显示地图。
你去吧
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+PreferenceData.getLatitude(HotelInfomation.this)+","+PreferenceData.getLongitude(HotelInfomation.this)+"&daddr="+latitude+","+longitude));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
答案 1 :(得分:0)
Intent intent = new Intent(
android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="
+ Data.map_latitude + ","
+ Data.map_longitude + "+&daddr="
+ Data.infoLatitude + ","
+ Data.infoLogitute + ""));