-1

I want to create a listview in listview (possibly an Expandable Listview).

This is the approach I took.

A first activity will have a listview and then for every each list item, a new activity will open and this activity will contain a reference to the previous ListView.

But this means that i need to develop several activities.

Is there any shorter way in which I can achieve this?

Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79
Sadik
  • 245
  • 1
  • 3
  • 13

1 Answers1

1

Why not try an expandable listview? Here is a great example.

A view that shows items in a vertically scrolling two-level list. This differs from the ListView by allowing two levels: groups which can individually be expanded to show its children. The items come from the ExpandableListAdapter associated with this view.

Expandable lists are able to show an indicator beside each item to display the item's current state (the states are usually one of expanded group, collapsed group, child, or last child). Use setChildIndicator(Drawable) or setGroupIndicator(Drawable) (or the corresponding XML attributes) to set these indicators (see the docs for each method to see additional state that each Drawable can have). The default style for an ExpandableListView provides indicators which will be shown next to Views given to the ExpandableListView.

Community
  • 1
  • 1
Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79