1

I'm retrieving data from firebase database in Recycler view and I'm using FirebaseRecyclerAdapter. I'm getting data properly, but the problem is Recycler view shows the data after fetching all the data from the array and takes too much time to load all the data. i just want to retrieve the data one by one or I just want to get data in batches like 10 items at once then next 10 items. or it loads the data with scrolling of the Recycler view.

sam
  • 216
  • 4
  • 17
  • 1
    i have an answer here http://stackoverflow.com/a/41259419/5381331, hope it help – Linh Feb 24 '17 at 06:21
  • but i want to endAt at last uploaded item. how can i decleare that?? can suggest something – sam Feb 24 '17 at 08:44

1 Answers1

0

I think firebase gives a good documentation with working with lists of data. https://firebase.google.com/docs/database/android/lists-of-data

If you want to retrieve one by one use ChildEventListener and if by batch you can use ValueEventListeners. Then you may limit the size by using filtering methods of firebase like startAt(), endAt(), etc.

bumblebeen
  • 642
  • 8
  • 21
  • but I'm using FirebaseRecyclerAdapter. how can I put **ChildEventListener ** in FirebaseRecyclerAdapter?? – sam Feb 24 '17 at 08:47