How to apply multiple Filters on an Adapter?

荒凉一梦 提交于 2019-12-01 10:30:25

I suppose that you implemented the filter yourself. As you cant get two filters you could have a field in the filter that defines what kind of filtering should by applied ( you could use multiple filters in your filter).

Set you field of the filter to the value you want before using the filter.

Or:

Use the keyword to choose the filter to apply. Add on the beginning of the keyword some characters which define the filter to apply. With String.beginsWith() you can check which type of filtering has to by applied. This has to be done in the Filter itself. The caller of the getFilter.filter(keyword) has to know what characters have to by added in front of the string.

Apply Multiple Filter in Listview and also use the multi sorting in ListView, try this link:

https://github.com/apurv3039/filter_listview/tree/master

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!