Привет, как сказал Ватсал, вы можете создать фильтр из адаптера. Таким образом, я решил, что я создал ArrayAdapter как переменную класса.
// ...
private void setListAdapter() {
List<Word> words = Dictionary.getInstance(this).getWords();
arrayAdapter = new ArrayAdapter<>(
this,
android.R.layout.simple_list_item_activated_1,
android.R.id.text1,
words);
// Sets the List Adapter that we are using
this.setListAdapter(arrayAdapter);
}
// ...
затем из этого класса переменной в onQueryTextChange или onQueryTextSubmit вы можете получить фильтр, как так
//...
public boolean onQueryTextChange(String query) {
// By doing this it removes the popup completely which was arising from using the this.getListView().setFilterText(query) method
arrayAdapter.getFilter().filter(query);
return true;
}
//...
Возможный дубликат [Как удалить всплывающий текст из фильтра списке следует?] (HTTP: // stackoverflow.com/questions/7999083/how-do-imove-popup-text-from-listview-filter) – blahdiblah