谷歌导航(Android 1.6的)意图回调 [英] Google Navigation (Android 1.6) intent callback
问题描述
我使用的意图来启动谷歌导航:
I'm using intents to launch Google Navigation:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location));
startActivity(i);
位置
是一个字符串,GPS坐标。
location
is a string with GPS coordinates.
谷歌导航弹出很好,绘制了路线。他们可以返回一些类型的回调,当用户到达目的地?实施任何方式 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()
?
如果没有,这将是我最好的选择?我一直在考虑在不断位置标签后台运行的服务和结束谷歌导航,回到我的应用程序,当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
服务挂在里面。当用户得到接近目的地的坐标,我只是终止谷歌导航,并开始我的活动恢复正常。
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.
这篇关于谷歌导航(Android 1.6的)意图回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!