Use this code inside a callback onScrolled()
.
int lastVisibleItem = ((LinearLayoutManager) layoutManager).findLastVisibleItemPosition();
int totalItemCount = layoutManager.getItemCount();
if (lastVisibleItem >= totalItemCount - 10) {
loadMore();
}
source
to share