首页 > 解决方案 > 我想通过我的应用启动谷歌地图通过意图启动驾驶模式

问题描述

我已经在整个互联网上搜索了这个意图,但直到现在还没有成功,到目前为止我发现的只是相同的旧路线意图,这里有人可以帮助我。随附的是我希望我的应用程序登陆的屏幕。 这是我希望我的应用程序登陆的地方

标签: androidgoogle-mapsandroid-intent

解决方案


试试下面的代码:

String URL = "https://www.google.com/maps/dir/?api=1&travelmode=driving&dir_action=navigate&destination=Ahmedabad";
Uri location = Uri.parse(URL);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, location);
startActivity(mapIntent);

推荐阅读