android - listview filter count

后端 未结 2 1674
迷失自我
迷失自我 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 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);
        }
    });
    

提交回复
热议问题