I have a fragment in which I do a network call and populate the contained recycler view with cards. Now I followed this to add a filter to my recycler view. Now the problem arises when in the adapter constructor I do
this.storeLists = new ArrayList<>(storeLists);
the List in my fragment gets populated but doesn't show any item until I click the searchview icon and start typing something. After that even if I close the searchview the list retains.
I tried changing the above line to
this.storeLists = storeLists;
when I remove the search query the deleted items are not re shown. So in case if I search something non - existent in my recycler view list, I am left with nothing showing in my recycler view.
What I want is that when I open the fragment I see the result and then when I click the search icon and start typing the filters work as shown in the link above.
EDIT: