开发者

Cannot filter ListView with CursorAdapter subclass

开发者 https://www.devze.com 2023-02-01 22:51 出处:网络
I have a subcla开发者_Python百科ss 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 CursorA

I have a subcla开发者_Python百科ss 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消