Created
October 21, 2016 13:11
-
-
Save matdziu/12b6efc2deadf4e3f5452182aaa6ba33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { | |
| @Override | |
| public boolean onQueryTextSubmit(String query) { | |
| return true; | |
| } | |
| @Override | |
| public boolean onQueryTextChange(String newText) { | |
| if (!newText.isEmpty()) { | |
| RecyclerView.Adapter adapter = new NamesAdapter(namesAPI.searchForName(newText)); | |
| recyclerView.swapAdapter(adapter, false); | |
| } | |
| return true; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment