简体   繁体   中英

How to fill data in RecyclerView in android?

My app is using RecyclerView to load the data from Backend Endpoints API . After connecting the API I am getting some x amount of data. I am successfully able to load the data in StaggeredGridView in RecylerView .

Now, user scrolldown to bottom and reach at Last Position . How can I make able to another request to fetch next x amount of data and so on? (Like Gmail App does. Gmail app shows a spinner and load next span of data)

I am new in Android and How can I achieve it?

It is quite simple, just check the onScrolled event. You can check this answer for more details:

https://stackoverflow.com/a/26643292/4244598

You can also start loading before the user reacher the end of the list if you wish. I hope this helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM