Cannot filter ListView with CursorAdapter subclass

两盒软妹~` 提交于 2019-12-11 06:36:47

问题


I have a subclass of CursorAdapter and I would like to filter my listview. I know that this can be accomplished with an ArrayAdapter as stated here and that way using a custom CursorAdapter does not work for me. I would like to do this with a custom CursorAdapter. What should I override and can I have an example?


回答1:


You can use CursorAdapter.setFilterQueryProvider to filter the list. I have an example on my blog -- it's in the context of an AutoCompleteTextView, but it should work the same way for a ListView.



来源:https://stackoverflow.com/questions/4559640/cannot-filter-listview-with-cursoradapter-subclass

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