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

前端 未结 3 957
执笔经年
执笔经年 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:22

    The setTextFilterEnabled() method doesn't automatically implement filtering, as it doesn't know what in your Cursor the text should be filtered against.

    This android-developers thread has more details.

    Actually, there was a good question asked the other day, which actually is very similar to your question; though it originally was asking how to handle filtering when there is no physical keyboard on a device:

    • How to dynamically update a ListView on Android

提交回复
热议问题