0
@Override
    public void onLocationChanged(Location location) {
       if (location != null) {
            GeoQuery query = geoFire.queryAtLocation(
                new GeoLocation(location.getLatitude(), location.getLongitude()),
                DistanceConstants.FILTER_DISTANCE
        );

        query.addGeoQueryEventListener(this);
       }
    }

@Override
    public void onKeyExited(String key) {
        Toast.makeText(context, "Key removed", Toast.LENGTH_SHORT).show();
    }

The OnKeyEntered() is executed properly based on my needs. The results are also perfect. However, OnKeyExited() method is never executed. I have 0.2 KM as the radius and whenever new keys are appearing within my 0.2 KM they are getting added but those are leaving my area of interest, they are not getting removed.

Any particular reason for this?

1 Answer 1

0

I was an idiot. Needed to use the setCenter() to update my query and everything is working as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.