Code example for Filter

Methods: filter

0
        Log.d("ppgllrd", "setFilterSLF" + query);
        this.query = query;
        if(adapter != null) {
        Filter currentFilter = adapter.getFilter();
        if(currentFilter != null)
            currentFilter.filter(StringUtils.removeAccents(query.toString().trim()));
        //Note that filter uses toString in Student 
        } 
        return true; 
    } 
 
    public void setOnQueryTextListener(Menu menu) {
        MenuItem menuItem = menu.findItem(R.id.search_box);
        final SearchView searchView = (SearchView) menuItem.getActionView();
        Log.d("ppgllrd", "setOnQueryTextListenerSLF" + searchView.getQuery().toString() + menu + getActivity());
        if (searchView != null) {
            Log.d("ppgllrd", "setOnQueryTextListenerSLF2" + searchView.getQuery());
 
            //searchView.setQuery(query, false); 
            if(!query.isEmpty())
                menuItem.expandActionView();