0

I followed the FirebaseUI doc about firestorepaging adapter, but now I intend to to reload "next page" using a button?

Can somebody give guidance how to proceed from here?

Query baseQuery = mItemsCollection.orderBy("value", Query.Direction.ASCENDING);

// This configuration comes from the Paging Support Library
// https://developer.android.com/reference/android/arch/paging/PagedList.Config.html
PagedList.Config config = new PagedList.Config.Builder()
        .setEnablePlaceholders(false)
        .setPrefetchDistance(10)
        .setPageSize(20)
        .build();

// The options for the adapter combine the paging configuration with query information
// and application-specific options for lifecycle, etc.
FirestorePagingOptions<Item> options = new FirestorePagingOptions.Builder<Item>()
        .setLifecycleOwner(this)
        .setQuery(baseQuery, config, Item.class)
        .build();
GhostCat
  • 137,827
  • 25
  • 176
  • 248
  • **[This](https://stackoverflow.com/questions/50592325/is-there-a-way-to-paginate-queries-by-combining-query-cursors-using-firestorerec/50692959)** is a recommended way in which you can paginate queries by combining query cursors with the limit() method on button click using an `ArrayAdapter`. If you intend to use `FirestorePagingAdapter` you'll lose the real-time feature as Frank explains [here](https://stackoverflow.com/questions/50273741/firestorepagingadapter-not-receiving-realtime-updates). – Alex Mamo Aug 20 '18 at 13:08
  • Reworded to make question more clear – GhostCat Aug 20 '18 at 19:04
  • @AlexMamo I prefer firestorepaging adapter because I don't need real-time features in my app – Lack Boker Aug 21 '18 at 08:56
  • The paging adapter is designed for infinite scrolling, so you shouldn't have to add a button—it'll just keep loading forever as you scroll. – SUPERCILEX Aug 24 '18 at 00:45

0 Answers0