Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 通过源和目标的意图打开地图_Android_Google Maps_Android Intent - Fatal编程技术网

Android 通过源和目标的意图打开地图

Android 通过源和目标的意图打开地图,android,google-maps,android-intent,Android,Google Maps,Android Intent,对不起我的英语 这段代码运行良好,但是,它打开了多条路由。如果我点击路线,它就会出现在地图上 我的问题是,有没有任何方法可以让我直接跳转到地图,而无需用户交互 这是您要查找的默认位置吗?这已经得到了回答:我认为没有办法改变多条路线。 Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20

对不起我的英语

这段代码运行良好,但是,它打开了多条路由。如果我点击路线,它就会出现在地图上


我的问题是,有没有任何方法可以让我直接跳转到地图,而无需用户交互

这是您要查找的默认位置吗?这已经得到了回答:我认为没有办法改变多条路线。
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"));

intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");

startActivity(intent);