1

I want to create a expandablelistview that has more than two levels ,and the data is from the database, which has the id,name,parentid , but the default layout of the expandablelistview component is two levels , so how could i do

zhy
  • 11
  • 1
  • 4

1 Answers1

1

You cannot do it using the Expandalble List built in in Android.

You would have to write an adapter of your own. People have done it. I've seen several implementations of file browsers that have multi-layer expandable lists. Some might even have the code available so you could take a peek and see how it was done if you can't figure out how to do it yourself.

EDIT

Found some code. One of these should do the trick for you.

tree-view-list-android extends baseadapter

SO Answer with link to code for using a modified BaseExpandableListViewAdapter.

Community
  • 1
  • 1
Barak
  • 16,318
  • 9
  • 52
  • 84
  • really , i didn't find even one example , most of the examplese are two levels ,so can you give give me one example ? – zhy May 23 '12 at 09:20
  • Found some code. Put the links in my answer. If it helps you out, please accept the answer (click the check mark next to it). That not only lets everyone know your issue has been resolved, it gives the person who answered your question credit for helping you out. – Barak May 23 '12 at 12:01