Wednesday, 18 May 2016

Pagination in Android Recyclerview


android.jpg

Step 1- Defined here  some necessary variable  
  1.  boolean isLoading=false;    -> this variable will use to show progressbar below to recyclerview in your xml file  when you scroll your recyclerview list .

  2. int mPageSize=10;  -> Number of items you want to fetch from server in a once.

  3.    
Step-2 Set addOnScrollListener to recyclerview

  1. int mTotalItemsCount -> Total item on server side.

  2. recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
  3.           @Override

Explore the full Blog about Pagination in android recyclerview at Findnerd.

No comments:

Post a Comment