Reputation: 11
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
Upvotes: 1
Views: 1533
Reputation: 16393
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.
Upvotes: 1