title: How to paginate Firestore with Android?
body: <p>I read Firestore documentation and all articles on internet(stackoverflow) about Firestore pagination but no luck. I tried to implement the exact code in docs, but nothing happens. I have a basic database with items(over 1250 or more) and I want to get them progressively. By scrolling to load 15 items (to the last item in the database).</p>
  
  <p>If using docs code:</p>
  
  <pre><code>// Construct query for first 25 cities, ordered by population
  Query first = db.collection("cities")
      .orderBy("population")
      .limit(25);
  
  first.get()
      .addOnSuccessListener(new OnSuccessListener&lt;QuerySnapshot&gt;() {
      @Override
      public void onSuccess(QuerySnapshot documentSnapshots) {
          // ...
  
          // Get the last visible document
          DocumentSnapshot lastVisible = documentSnapshots.getDocuments()
              .get(documentSnapshots.size() -1);
  
          // Construct a new query starting at this document,
          // get the next 25 cities.
          Query next = db.collection("cities")
              .orderBy("population")
              .startAfter(lastVisible)
              .limit(25);
  
          // Use the query for pagination
          // ...
      }
  });
  </code></pre>
  
  <p>How to do? Documentation has not too many details.</p>
  
  <p>PS: I need with recycler view (not list view) when user scrolls. Thanks</p>