Set notifyDataSetChanged() on Recyclerview adapter
you are setting the new list to the RecyclerView Adapter , set the list in the Adapter:
make a method setItems(list)
in adapter and call it before notifyDataSetChanged()
and in adapter do
this.persons = new ArrayList<>(persons);
in setItems
add this method in adapter:
public void setItems(List<ServiceModel> persons) {
this.persons = persons;
}
and call it before notifyDataSetChanged()
like this:
adapter.setItems(list);
adapter.notifyDataSetChanged();