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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With