我有一个由SimpleCursorAdapter支持一个ListView。
I have a ListView that is backed by a SimpleCursorAdapter.
我希望能够过滤列表中像你这样一个联系人列表,仅仅通过打字,我遇到了textFilterEnabled()
I'd like to be able to filter the list like you would a contacts list, just by typing, and I came across the textFilterEnabled()
但问题是,我看不出如何让它与SimpleCursorAdapter工作。
Problem is, I couldn't see how to get it to work with a SimpleCursorAdapter.
这甚至可能吗? 如果是的话,它怎么办?
Is this even possible? If so, how is it done?
推荐答案
在 setTextFilterEnabled()
方法不会自动实现过滤,因为它不知道的什么的在光标
文本应进行筛选。
The setTextFilterEnabled()
method doesn't automatically implement filtering, as it doesn't know what in your Cursor
the text should be filtered against.
这android-developers螺纹有更多的细节。
其实,有一个很好的问题,提出有一天,这实际上是非常相似,你的问题;虽然它最初是问如何处理过滤时,有一个设备上没有物理键盘:
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:
http://stackoverflow.com/questions/1737009/answer-to-making-a-nice-looking-listview-filter-on-android相关推荐
最新文章