我正在创建一个应用程序,我需要在其中启动导航应用程序,然后使用结果(最重要的是行驶距离)。我使用 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/