android - listview filter count

后端 未结 2 1673
迷失自我
迷失自我 2020-12-31 13:13

So after I set the filter on my listview:

//Log adapter count before filter
listView.getFilter().filter(searchStr)
//Log adapter count after filter


        
相关标签:
2条回答
  • 2020-12-31 13:54

    Try calling listview.getCount() after applying the filter.

    0 讨论(0)
  • 2020-12-31 14:14

    This is how I managed to do it:

    myAdapter.getFilter().filter(searchText, new Filter.FilterListener() {
        public void onFilterComplete(int count) {
             Log.d("log", "result count:" + count);
        }
    });
    
    0 讨论(0)
提交回复
热议问题