简体   繁体   English

Android如何实现可扩展的listview过滤搜索?

[英]Android how to implement expandable listview filter search?

I am trying to develop an android application with expandable list view able to search group items from filter search. 我正在尝试开发具有可扩展列表视图的android应用程序,该应用程序能够从过滤器搜索中搜索组项目。

I have found many tutorials that do just that where a search-bar is placed at the top and if you type in the box the results get filtered. 我发现有很多教程只是在顶部放置了搜索栏,如果您在框中输入,则会过滤结果。

I able find this and this for something very related to my problem and i have followed up this way to implementation. 我能够找到这个这个与我的问题非常相关的东西,并且我已经按照这种方式实施了。

I was unable to get successful result. 我无法获得成功的结果。 its not working without prompting any errors. 它不提示任何错误就无法正常工作。 please suggest me some tutorial to achieve this task. 请为我建议一些教程以完成此任务。

appreciate any help.. 感谢任何帮助。

Implementing your own filtered searching can be annoying, tricky, and buggy if not done correctly. 如果执行不正确,实施自己的筛选搜索可能会很烦人,棘手且容易出错。 Unfortunately Android does not provide a filterable adapter for use with the ExpandableListView which means you need to roll your own solution. 不幸的是,Android没有提供与ExpandableListView一起使用的ExpandableListView过滤适配器,这意味着您需要推出自己的解决方案。 Rather then going through all that pain, I suggest using the RolodexArrayAdapter . 建议您使用RolodexArrayAdapter ,而不要经历所有的痛苦。 It's a full fledged ExpandableListAdapter that adds filtering support (as well as many other things). 这是一个完整的ExpandableListAdapter ,增加了过滤支持(以及许多其他功能)。 Additionally there's a demo app with plenty of example code to show the various ways in which to use it. 此外,还有一个演示应用程序,其中包含大量示例代码,以展示使用它的各种方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM