【发布时间】:2015-08-24 20:16:59
【问题描述】:
我的应用有一个自定义的 ListView-Adapter,它可以将一个 listview_item 膨胀,它有多个 TextView 到一个 ListView 中。
我在布局中添加了一个 SearchView,但我想要它,以便它可以搜索 ListView 并通过查看在 SearchView 中键入的数据是否与来自 listview_items 的 TextView 中的任何数据相同来过滤它。
【问题讨论】:
-
在 SearchView 上使用 TextWatcher,然后获取搜索词并在迭代数据集时使用它与您的数据进行比较。
-
@inner_class7 你能给个代码示例吗?我发现很难想象你的意思。不过感谢您的评论。
标签: android listview android-listview filter searchview