【发布时间】:2013-11-16 09:38:50
【问题描述】:
我想知道是否可以检索谷歌地图的导航历史。换句话说,有没有办法检索 Google 地图应用的用户最近使用/搜索的路线?
谢谢
【问题讨论】:
标签: android google-maps
我想知道是否可以检索谷歌地图的导航历史。换句话说,有没有办法检索 Google 地图应用的用户最近使用/搜索的路线?
谢谢
【问题讨论】:
标签: android google-maps
您无法完成 Google 导航应用。
我发现只有一项工作可以解决, 以当前位置重新开始导航,导航将自动结束。
public static void startNavigationIntent(Context activity, String destination)
{
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + destination));
activity.startActivity(intent);
}
然后将您的应用带到前台。
Intent bringToForegroundIntent = new Intent(BackgroundLocationService.this, DashboardActivity.class);
bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(bringToForegroundIntent);
【讨论】:
没有可用于从导航应用程序获取信息的 API。但是您可以向地图提供一些数据,以通过 Intent / URI 请求路线。
但我不认为地图应用程序会保存整条路线,只会保存目的地。用户选择任何保存的目的地,您可以从任何来源到达那里。
【讨论】: