Delete item recyclerView

Delete 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

Leave a Reply

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