I have a editext for search in a list view. I want to check if listview adapter is filtered by any text or not. Here is my code:
Button search=(Button)fi
Filter has a overridden method with Filter.FilterListener
which you can use .
search.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
adapter.getFilter().filter(inputSearch.getText().toString(),new Filter.FilterListener(){
@Override
public void onFilterComplete(int count) {
if (count == 0){
// List empty
} else {
// List has data
}
}
});
}});