可以在导航器上显示两个coords启动googlemaps之间的路线? (编程)

时间:2011-11-18 11:59:14

标签: android google-maps

我知道我可以这样做:

            Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
            Uri.parse("http://maps.google.com/maps?saddr=39.45798340851973,-0.3835865820296931&daddr=39.44353524837272,-0.3760334814437556"));              
            startActivity(intent);

但我需要删除对话框,并将其打开以启动导航器¿如何操作?

我知道我可以通过intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");

打开对话框以打开googlemap应用程序

但我需要恰恰相反,才能启动导航仪。

1 个答案:

答案 0 :(得分:1)

Intent i = new Intent();

i.setComponent(new ComponentName("com.android.browser", "com.android.browser.BrowserActivity"));
i.setAction("android.intent.action.VIEW");
i.addCategory("android.intent.category.BROWSABLE");
Uri data = Uri.parse("http://www.google.com");
i.setData(data);

startSubActivity(i, 2);