Paginate.Callbacks.onLoadMore() method is invoking two times
See original GitHub issueHello @MarkoMilos,
First of all, thanks a lot for creating such a wonderful API for pagination. It works smooth for me. But this is having an issue, if invoking onLoadMore() method on activity onCreateView(), REST API is invoking two times. This is happening because of below code:
private final RecyclerView.OnScrollListener mOnScrollListener = new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { checkEndOffset(); // Each time when list is scrolled check if end of the list is reached } };
Method RecyclerView.OnScrollListenervoid onScrolled (RecyclerView recyclerView, int dx, int dy): Source[https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnScrollListener.html#onScrolled(android.support.v7.widget.RecyclerView, int, int)] Callback method to be invoked when the RecyclerView has been scrolled. This will be called after the scroll has completed. This callback will also be called if visible item range changes after a layout calculation. In that case, dx and dy will be 0.
So could you please add some condition to prevent onScrolled() method invocation on view creation. This will be helpful.
Thanks, Chandan Kushwaha
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
@ckushwaha207 Please write your decision, I catch double call onLoadMore too (using simple activity and recyclerview).
Cannot reproduce this and no example is provided 😦 Closing due to inactivity.