location-samples
location-samples copied to clipboard
Geofence triggers on enter/exit with no error but no GEOFENCE_TRANSITION_ flag
I am using a code similar to the one in the samples (below). The Geofence usually triggers with no error, but no GEOFENCE_TRANSITION_ flag is returned from GeofencingEvent.getGeofencingTransition()
protected void onHandleIntent(Intent intent)
{
final GeofencingEvent event = GeofencingEvent.fromIntent(intent);
if (event.hasError())
{
Log.e(TAG, getErrorMessage(event.getErrorCode()));
return;
}
switch (event.getGeofenceTransition())
{
case Geofence.GEOFENCE_TRANSITION_EXIT:
// OnExit (not working)
break;
case Geofence.GEOFENCE_TRANSITION_ENTER:
case Geofence.GEOFENCE_TRANSITION_DWELL:
// OnEnter (not working)
break;
default:
//Triggered everytime (enter or exit)
}
}
What is being returned instead of the correct values? Null?