location-samples icon indicating copy to clipboard operation
location-samples copied to clipboard

Geofence triggers on enter/exit with no error but no GEOFENCE_TRANSITION_ flag

Open amrabed opened this issue 8 years ago • 1 comments

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

amrabed avatar Jan 05 '17 09:01 amrabed

What is being returned instead of the correct values? Null?

shailen avatar Oct 17 '17 06:10 shailen