Google Navigation (Android 1.6) intent callback(Google Navigation (Android 1.6) 意图回调)
问题描述
我正在使用 Intent 启动 Google 导航:
I'm using intents to launch Google Navigation:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location));
startActivity(i);
location
是一个带有 GPS 坐标的字符串.
location
is a string with GPS coordinates.
Google Navigation 会很好地弹出并绘制路线图.当用户到达目的地时,他们可以返回某种类型的回调吗?有什么方法可以实现 startActivityForResult()
?
Google Navigation pops up nicely and plots the route. Can they return some type of callback when the user has reached their destination? Any way of implementing startActivityForResult()
?
如果不是,我最好的选择是什么?我一直在考虑在后台运行一项服务,该服务会密切关注位置并结束 Google 导航,并在 GPS 记录它在目的地附近时返回我的应用程序(因为我知道纬度/经度).
If not, what would be my best bet? I've been considering running a service in the background that keeps tabs on the location and ending Google Navigation and returning to my app when the GPS registers that it's near the destination (because I know the latitude/longitude).
谢谢大家
推荐答案
我想发布我是如何设法让它工作的.我没有使用活动回调,但我正在启动一个带有 LocationManager
的服务.当用户接近目的地坐标时,我只是终止 Google Navigation 并重新开始我的活动.
I wanted to post how I managed to get this to work. I'm not using activity callbacks, but I am starting a service with a LocationManager
hanging out in it. When the user gets close to the destination coordinates, I just terminate Google Navigation and start my activity back up.
这篇关于Google Navigation (Android 1.6) 意图回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Google Navigation (Android 1.6) 意图回调


- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01