Load More in RecyclerView with Progressbar

Load More in RecyclerView with ProgressBar - Banner - Know My Work

SVB

I am an Engineer by profession. I love to learn new technology stacks and share my learning with people.

Leave a Reply

Comment as a guest.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. if (mOnLoadMoreListener != null) {
    mOnLoadMoreListener.onLoadMore(mDataset.get(position));
    }
    loading = true;
    }

    at com.example.avibis.practicerecyclerview.Adapter.removeLastItem(Adapter.java:117)
    at com.example.avibis.practicerecyclerview.MainActivity.loadMoreData(MainActivity.java:71)
    at com.example.avibis.practicerecyclerview.MainActivity$1.onLoadMore(MainActivity.java:57)
    at com.example.avibis.practicerecyclerview.Adapter.onBindViewHolder(Adapter.java:89)

    I am facing that type of Problem…
    How can I solve it?

    1. Hi Avishek,

      Thank you for pointing this out. There was a mistake in my code.

      Instead of

      mOnLoadMoreListener.onLoadMore(mDataset.get(position));

      it should be

      mOnLoadMoreListener.onLoadMore(position);

      I have corrected my code above. I’m sorry for the mistake.

  2. I have an error:
    at com.example.root.mitchapp.RecyclerViewAdapter.removeLastItem(RecycleViewAdapter.java:126)
    at com.example.root.bilel.MainActivity.loadMoreData(MainActivity.java:94)
    at com.example.root.bilel.MainActivity$1.onLoadMore(MainActivity.java:67)
    at com.example.root.bilel.RecyclerViewAdapter.onBindViewHolder(RecycleViewAdapter.java:90)

    1. Hi! Bilel,

      Have you implemented the exact same code given above or you made some changes? In the latter case, I need more data to resolve your problem.

      Thank you!

  3. thank you for your code it was brilliant but i get this error below
    Cannot call this method while RecyclerView is computing a layout or scrolling
    i have this problem at this function
    public void removeLastItem(){
    Works.remove(Works.size() – 1);
    notifyDataSetChanged();
    }
    on notifyDataSetChanged();
    what should i do

  4. I like this post because it contains a lot of useful information to read, maybe everyone will like me. I hope this post of yours will be more appreciated by it really excellent, i enjoyed it, thanks for posting it.

Read Next

Sliding Sidebar

About Me

About Me

I am an Engineer by profession. I love to learn new technology stacks and share my learning with people.

Follow Me

Subscibe for Newsletter