Search code examples
androidlocationandroid-geofence

Calling a method upon exiting Geofence


I want to call a method in when the user has exited the geofence radius, I'm not entirely sure how to go about that. It seems I have to work with GeofenceTransitionsIntentService(), but all I'm finding is outdated code


Solution

  • The API docs have a full fledged example on how to do this. Simply use a conditional to check geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT in the onHandleIntent of your Geofence Service: developer.android.com/training/location/geofencing.html