I'm trying to implement the google's paging library in my project. All things are already coded and network call is working in loadInitial() But it never goes in loadAfter(). As code structure is very complex I am not posting code directly here.
Here's the repository :
https://github.com/raghavsatyadev/PagingDemo
File link : https://github.com/raghavsatyadev/PagingDemo/blob/master/app/src/main/java/com/rocky/invmx/modules/order/OrdersActivity.java
It is not an answer to the given question, but really similar problem.
In onBindViewHolder
use getItem(int index)
instead of getting item from currentList
. As the accepted answer says - it is needed to call getItem
to trigger loadAfter
in DataSource
.
You are overriding getItem(int index)
method in GenPagingRecyclerAdapter.java
class without calling the super.getItem(index)
. If you look at the PagedListAdapter.java
and dig into the method call you will see that this method internally calls the loadAfter
method. So first the solution to your problem is to remove the getItem(int index)
from GenPagingRecyclerAdapter.java
class. Because you are not doing anything in it and if you really want to override getItem(int index)
then call the super.getItem(int index)
at start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With