I am doing one Android project using sqlite DB and was able to populated the lists in listview.
I was also able to search the words in listview using following codes:
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
MainActivity.this.myAdapter.getFilter().filter(s);
or
@Override
public boolean onQueryTextChange(String newText) {
if (TextUtils.isEmpty(newText)) {
lvUsers.clearTextFilter();
} else {
lvUsers.setFilterText(newText.toString());
}
return true;
}
but i am getting random words which is related to the entered string from listview, suppose i have words like apple, an , bool,abc, abort, boll, god , good etc. So i need to get only "bool", "boll" while i enter "b" EditText or searchview. but now i am getting bool,abc,abort and boll so on.
therefore, your kind helps are most appreciated.Thank You