Remove item recyclerView
When we delete a item in our recyclerView, first step is in our adapter We must to add this:
1 2 3 4 | void deleteItem( int index) { mDataset.remove(index); notifyItemRemoved(index); } |
And now our fragment or activity we call the method like this:
1 | mAdapter.deleteItem(position); |
The example is in GitHub
Hopefully this steps will help you removing items from a recycler view, please, drop us a comment if you have any problems with this code.
thanks
Thanks Alot! :XXX