Skip to content

Instantly share code, notes, and snippets.

@matdziu
Last active November 17, 2016 11:49
Show Gist options
  • Select an option

  • Save matdziu/4030685fe95ddc49c38f438f97c74419 to your computer and use it in GitHub Desktop.

Select an option

Save matdziu/4030685fe95ddc49c38f438f97c74419 to your computer and use it in GitHub Desktop.
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
if (!newText.isEmpty()) {
adapter.setNamesList(namesAPI.searchForName(query));
adapter.notifyDataSetChanged();
}
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment