RecyclerView deleting item doesn't call OnScrollListener

1k views Asked by At

There seems to be a lot of post on how one can scroll up for more posts and I have posted a question on this before: Adding items to Endless Scroll RecyclerView with ProgressBar at bottom

However, I have a question on deleting items in a list on recyclerview. You have an android app which fetches 5 items from the database server in a page. As soon as it fetches it, you start deleting items one by one.

The list recyclerview scrolls up but the OnScrollListener is not called as you haven't really "scrolled".

How do I address this problem when I want to add on more items to my list as my delete start eliminating items from the top?

1

There are 1 answers

2
jayant singh On

when deleting each item call

recyclerView.smoothScrollToPosition(0); 

it works perfectly