tags:

views:

884

answers:

2

I'm using intents to launch Google Navigation:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location)); 
startActivity(i);

location is a string with GPS coordinates.

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()?

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).

Thanks folks

+2  A: 

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.

mattbasta
A: 

hi,

what is the format for location???

latitude,longitude?

it says to me "we couldnt understand the destnation"

androidman
That's what I'm using and it works fine. You might need the latest version of Google Maps.
mattbasta