Code example for Filter

Methods: filter

0
        searchViewStrategy = (Build.VERSION.SDK_INT >= HONEYCOMB) ? new HoneycombStrategy() : new LegacyStrategy();
        searchViewStrategy.setup(searchMenuItem, new SearchViewStrategy.OnFilterTextListener() {
            public void onFilterTextChange(String newText) {
                Filter filter = filterable.getFilter();
                if (filter != null)
                    filter.filter(newText);
            } 
 
            public void onFilterTextSubmit(String query) {
                Log.d(TAG, "onFilterTextSubmit : '"+query+"'");
                clearSearchViewOnSubmit(); 
            } 
        }); 
    } 
 
    public void onSearchRequested() { 
        searchMenuItem.expandActionView();
    } 
 
    /** 
Experience pair programming with AI  Get Codota for Java