How to create another listview adapter?

How to create complex ListView with grouped items?

  • I'm trying to create ListView adapter for grouped contents. I cannot use just multiple types of list items, because I've got complex design(image is not real design, but the layout): You can see from image, that there are list item views inside group view. And group view has set background for whole group, not just for its header. Therefore I cannot use ExpandableListView either: http://www.mobiledevguide.com/2012/09/how-to-work-with-android.html. Is it possible somehow possible to implement that design using few inflated elements, and on-demand content population for these elements like ListView does? Or do I need to implement whole widget on my own? I've took quick look at ListView sources. It is almost 4k LOC! I know, that something similar is possible using hack: 3 types of list items: header, item, last_item_of_group. And fake background of group using these different items (header,item,item,item,last,header,item,item,...), but I can't do that now!

  • Answer:

Miro at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

I think you can use the MergeAdapter, I had done a similar view as the one you desire. https://github.com/commonsguy/cwac-merge

Mohamed Hamdaoui

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.