Java Code Examples for android.widget.SearchView#OnQueryTextListener
The following examples show how to use
android.widget.SearchView#OnQueryTextListener .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Listactivity.java From ImapNote2 with GNU General Public License v3.0 | 5 votes |
public boolean onCreateOptionsMenu(Menu menu){ getMenuInflater().inflate(R.menu.list, menu); // Associate searchable configuration with the SearchView SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); searchView.setSearchableInfo( searchManager.getSearchableInfo(getComponentName())); SearchView.OnQueryTextListener textChangeListener = new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextChange(String newText) { // this is your adapter that will be filtered listToView.getFilter().filter(newText); return true; } @Override public boolean onQueryTextSubmit(String query) { // this is your adapter that will be filtered listToView.getFilter().filter(query); return true; } }; searchView.setOnQueryTextListener(textChangeListener); return true; }
Example 2
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void onQueryText(SearchView.OnQueryTextListener arg) { return BaseDSL.attr("onQueryText", arg); }
Example 3
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void onQueryText(SearchView.OnQueryTextListener arg) { return BaseDSL.attr("onQueryText", arg); }
Example 4
Source File: PlaybackActivity.java From android-vlc-remote with GNU General Public License v3.0 | 4 votes |
public void setSearchViewOnQueryTextListener(SearchView.OnQueryTextListener listener) { mSearchViewOnQueryListener = listener; }