[Solved] Implement A Mutli Level Listview [closed]


It sounds like you’re looking for an ExpandableListView (docs here). However, it does not allow the level of nesting that you need.

To be honest though, I’d recommend against nesting items that deeply into a ListView setup using only ListViews. It makes navigation of the list items difficult/ messy (not to mention the programming side of things, which would be far worse). I would think of doing something along the lines of what follows:

  1. Use and ExpandableListView to achieve the Category->Sub-Category layout that you need.

  2. From there allow users to “click” on one of the sub categories to replace the ListView with a Fragment (don’t forget to put a back button).

  3. From the Fragment allow the user to view further details.

This example goes about it a little differently than what I outlined above, but it’s good, nonetheless.

This approach will make navigation much easier as well as simplifying your code.

Hope this helps.

solved Implement A Mutli Level Listview [closed]