How To Stop Incessant Crash On Search Filter In Android Recyclerview
I have been struggling to stop an index out of bounds exception crash every single time I do a search in a searchview. I tried a couple of things listed online : on search getting
Solution 1:
There is a problem with Filter
implementation. You are updating mSearchGuestListResponseListFiltered
in the performFiltering(CharSequence charSequence)
method and it's source of the error. You must update your list in publishResults(CharSequence charSequence, FilterResults filterResults)
method. So you must remove mSearchGuestListResponseListFiltered = filteredList;
(Line 234) from your adapter code.
In addition, you called notifyItemChanged()
method in getItemId()
and onBindViewHolder()
methods. I think it's wrong implementation as well and you should remove them.
Post a Comment for "How To Stop Incessant Crash On Search Filter In Android Recyclerview"