I have following scenario:
- When I launched the activity I need to load some data.
- The activity has refresh button which will load new data from the network. This will be a new list of data which will not match to the initial list.
- Now suppose user has scrolled down to page 6 before hitting refresh button. Now when user hits refresh how to update the whole list and jumping to the position 0 first page.
I tried below steps but did not get any success:
- Used InvalidatingPagingSourceFactory and invalidating it before calling adapter?.refresh()
- Tried to set nextpage to 0 when calling adapter?.refresh() but this also did not work.
Everytime data gets updated but recyclerview position is maintained. Please help. I want my recyclerview to point to the first item whenever I fill new data.