if (charSequence == null ||charSequence.length()==0) {
results.values = locations;
results.count = locations.size();
Log.v("!!!", "cleared filter");
locations = allLocations;
notifyDataSetChanged();
}
So, basically when you've already filtered, you're saying here that results.values = locations
which corresponds to the previous filtering. So if the new filtering pattern don't match the set that you previously filtered, it won't show anything, what you're basically experiencing. You have to first set locations = allLocations
and then set the results.*
params:
if (charSequence == null ||charSequence.length()==0) {
Log.v("!!!", "cleared filter");
locations = allLocations;
notifyDataSetChanged();
results.values = locations;
results.count = locations.size();
}