1

I have a SearchView. I filter RecyclerView according to the string inside the SearchView. The filtering is fine. But I want to reset the list to the original once the SearchView 'X' is clicked.

Here is what I have tried:

 searchM.QueryTextChange += searchCheckin_QueryTextChange;
 void searchMe_QueryTextChange(object sender, Android.Support.V7.Widget.SearchView.QueryTextChangeEventArgs e)
        {

            if (!string.IsNullOrEmpty(e.NewText))
            {
                filteredModelList = filter(dupes, e.NewText);
                mAdapter.AnimateTo(filteredModelList);
                mRecyclerView.ScrollToPosition(0);
            }
            else
            {
                searchMe.SetQuery("",false);
            }


        }

But this doesnt work and just clears the SearchView and does not show the original list.

How can I solve this and show the original list once the SearchView is cleared?

braX
  • 11,506
  • 5
  • 20
  • 33
hello world
  • 797
  • 1
  • 9
  • 31
  • Possible duplicate of [How to filter a RecyclerView with a SearchView](http://stackoverflow.com/questions/30398247/how-to-filter-a-recyclerview-with-a-searchview) – EmptyCup Nov 18 '15 at 09:07
  • Just reset the original data (full data) in else block. – Rami Nov 18 '15 at 09:25
  • @Rami I already have checked the question you mentioned. But I cant seem to get the reset workin – hello world Nov 18 '15 at 09:29
  • That was EmptyCup who mentioned the question. Post your adapter code. – Rami Nov 18 '15 at 09:44

0 Answers0