This code is not working properly. Whenever i search for an item starts with a capital letter it shows nothing in the list. It only shows letters starting with small alphabets.
@Override
public boolean onQueryTextChange(String s) {
String userinput= s.toLowerCase();
List<MultipleFoodWraper> newlist = new ArrayList<>();
for(MultipleFoodWraper name :multipleFoodWraperArrayList) {
if (name.getName().toString().contains(userinput)) {
newlist.add(name);
}
adapter.updatelist(newlist);
}
return true;
}
s.toLowerCase();
be the main cause of your issue?name.getName().toString().toLowerCase()
when comparing?