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?