The android geofire onKeyEntered is never executed for matching queryLocation. But onGeoQueryReady method is executed.
so when I click on the menu bottombar, the addGeoQueryEventListener is executed and the onGeoQueryReady method is executed. But the onKeyEntered method is never executed. as you can see in the attachment, I have the location in the same node as the top level node. I have also include child path "xxx_location" in the DB reference. below are my API version.
Geofire 2.1.1'
firebase-core:9.0.2'
Code:
///geofire connection
DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
DatabaseReference refLowLevel = ref.child("xxxxx_location");
if (refLowLevel!=null) {
GeoFire geoFire = new GeoFire(refLowLevel);
// creates a new query around [37.7832, -122.4056] with a radius of 0.6 kilometers
geoQuery = geoFire.queryAtLocation(new GeoLocation(37.12314,-122.49182),1.80);
Log.i(TAG, "query-------->"+geoQuery);
markers = new HashMap<String, Marker>();
geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {
@Override
public void onKeyEntered(String key, GeoLocation location) {
Log.i(TAG, "inside painter onkeynetered-------->");
//Marker marker = map.addMarker(new MarkerOptions().position(new LatLng(location.latitude, location.longitude)));
//markers.put(key, marker);
}
@Override
public void onKeyExited(String key) {
Log.i(TAG, "inside painter onkeyexited-------->");
}
@Override
public void onKeyMoved(String key, GeoLocation location) {
System.out.println(String.format("Key %s moved within the search area to [%f,%f]", key, location.latitude, location.longitude));
}
@Override
public void onGeoQueryReady() {
Log.i(TAG, "inside painter onqueryready-------->");
}
@Override
public void onGeoQueryError(DatabaseError error) {
System.err.println("There was an error with this query: " + error);
}
});
}