How to text filter an Android ListView backed by a SimpleCursorAdapter?

前端 未结 3 955
执笔经年
执笔经年 2020-12-05 01:11

I have a ListView that is backed by a SimpleCursorAdapter.

I\'d like to be able to filter the list like you would a contacts list, just by typing, and I came across

3条回答
  •  日久生厌
    2020-12-05 01:35

    i found this article helpful http://androidcookbook.oreilly.com/Recipe.seam;jsessionid=CE37400B3E545937B70BE2E9F94E78BB?recipeId=404

    basically, you setTextFilterEnabled(true) on your listview, and you use setStringConversionColumn() and setFilterQueryProvider() on your SimpleCursorAdapter.

提交回复
热议问题