Android Treeview

Daniel Sloof picture Daniel Sloof · Jul 17, 2010 · Viewed 59.2k times · Source

I know there is the ExpandableListView but it only supports up to 2 levels. I need a true treeview vertical list with at least up to ~5 levels (more is better).

Any suggestions?

edit:

I see talk about using a Custom Adapter and setting the padding based on the items level.

I have an unsorted ArrayList of objects that have an ID and parent ID, and I dynamically add items to this array as well.

Can anyone give me some examples of how I can go about doing this?

Answer

bmelnychuk picture bmelnychuk · Feb 14, 2015

I had the same issue. You can check out my implementation AndroidTreeView.

  • Its N-level tree.

  • Custom style for nodes

  • Save state after rotation

AndroidTreeView