I am using Geoquery to fetch nearest documents from Firestore in Android/Java. I try to paginate data with recyclerview. But somehow, .startAfter(lastVisible) clause makes the query work twice for different bound tasks. So, after first fetch, all queries works twice.
I am using Geoquery to fetch nearest documents from Firestore in Android/Java. I try to paginate data with recyclerview. But somehow,
.startAfter(lastVisible)
clause makes the query work twice for different bound tasks. So, after first fetch, all queries works twice.List<GeoQueryBounds> bounds = GeoFireUtils.getGeoHashQueryBounds(center, radiusInM);
final List<Task<QuerySnapshot>> nextTasks = new ArrayList<>();
for (GeoQueryBounds b : bounds) {
Query nextQuery = db.collection("posts")
.whereEqualTo("country_code", sharedpreferences.getString("country_code", ""))
.orderBy("geohash")
.startAt(b.startHash)
.endAt(b.endHash)
.startAfter(lastVisible)
.limit(10);
nextTasks.add(nextQuery.get()); }