Delete item recyclerView

Remove item recyclerView

Delete item recyclerView

When we delete a item in our recyclerView, first step is in our adapter We must to add this:

void deleteItem(int index) {
        mDataset.remove(index);
        notifyItemRemoved(index);
    }

And now our fragment or activity we call the method like this:

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.

2 thoughts on “Delete item recyclerView

Leave a Reply

Your email address will not be published. Required fields are marked *