android - 启动 Android 导航获取结果

标签 android android-intent navigation

我正在创建一个应用程序,我需要在其中启动导航应用程序,然后使用结果(最重要的是行驶距离)。我使用 startActivityForResult 开始导航 Activity 并使用方案“google.navigation”。像这样:

Intent i = new Intent(
    Intent.ACTION_VIEW,
    Uri.parse("google.navigation:q=Somewhere"));
startActivityForResult(i,1);

效果很好,当 Activity 完成时我收到回调,但 Activity 的数据部分为空。

有办法吗?

是否有导航历史可以浏览最近的行程数据?

最好的问候 雅各布·西蒙-加尔德

最佳答案

Is there a way to do this?

不,您无法强制一项 Activity 给您结果。 Activity 是否支持结果取决于 Activity 的作者,而不是 Activity 的调用者。

Is there a navigation history where I can browse the latest trip for data?

Google Navigation Android 应用(包括 google.navigation 方案)没有文档化和受支持的 API。

关于android - 启动 Android 导航获取结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27079236/

相关文章:

android - 在 Android 5.0 API 21 Lollipop 中,Seek Bar thumb 不透明

android - 如何将实时、不断更新的数据从 REST API 发送到移动应用程序?

android - 为什么电子邮件 Intent 在公共(public)(非 Activity )类中不起作用

css - 响应式功能区导航

ios - Swift - 导航栏未出现在自定义单元格的 Segue 中

android - 手机启动时服务没有启动

android - "Select image from gridview and display it on other intent"时出错

Android SMS intent exit_on_sent 移除消息正文

android - 以编程方式设置 Intent 类别

navigation - 如何将数据偏移添加到 Bootstrap 4 固定顶部响应式导航栏?