4

I am using the MergeAdapter from: https://github.com/commonsguy/cwac-merge

I want to add an ExpandableListadApter to the MergeAdapter but it currently takes in a type 'ListAdapter'. Does anyone know a way to do this?

CLDev
  • 1,076
  • 3
  • 12
  • 20
  • @ CLDev did you find the solution? Currently me too need this plz let me know if you find the Answer. http://stackoverflow.com/questions/27539400/how-to-show-all-list-items-in-child-listview-using-cwac-merge-1-0-4-jar – Jamal Dec 30 '14 at 11:56

1 Answers1

0

AFAIK, the MergeAdapter only supports the ListAdapter interface. Aside from forking the repo and adding support for the ExpandableListAdapter, there's really only one other way I think you could "hack" a quick solution.

Android uses an ExpandableListConnector to map an ExpandableListAdapter to a BaseAdapter. You could literally copy that class over to your project, and instantiate it with your ExpandableListAdapter. That'll give you a ListAdapter compliant adapter you can use with the MergeAdapter.

Note, I've never tried this...but theoretically it should work.

ExpandableListConnector source code

Ifrit
  • 6,791
  • 8
  • 50
  • 79