我正在使用意图来启动Google导航:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location));
startActivity(i);
location
是一个包含 GPS 坐标的字符串。
Google 导航会很好地弹出并绘制路线。他们能否在用户到达目的地时返回某种类型的回调?是否可以实现 startActivityForResult()
?
如果不能,那么我最好的选择是什么?我一直在考虑在后台运行一个服务来跟踪位置并在 GPS 注册附近目的地(因为我知道纬度/经度)时结束 Google 导航并返回到我的应用程序。
谢谢大家。