Skip to content Skip to sidebar Skip to footer

Android Application To Detect When Google Maps Direction Is Finished

I am building an android application, that will show certain points on google maps, for which I have (lat,lang) for all the points shown, with me. Whenever, a user clicks on one of

Solution 1:

As @Daniel mentioned, you can use onActivityResult() to detect when users are back. However, if you really want to detect if Google maps direction had finished... You can look at the notifications.

So the catch here is, when Google Maps direction is a services, and when it is running, it posts updates to the notifications center.

Which means either you can keep looking at what services are running, or.. get permission to the notifications center and keep checking if Google Maps exists.

enter image description here

Solution 2:

I think a better answer since you built the intent for navigation and have the coordinates, is to set up geofencing for the destination or any milestone you want in the trip. After that, you can use your IntentService to retrieve your app at the appropriate activity.

https://developer.android.com/training/location/geofencing#java

Post a Comment for "Android Application To Detect When Google Maps Direction Is Finished"