简体   繁体   中英

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.

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. Rather then going through all that pain, I suggest using the RolodexArrayAdapter . It's a full fledged ExpandableListAdapter that adds filtering support (as well as many other things). Additionally there's a demo app with plenty of example code to show the various ways in which to use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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