0

I would like to design an item like this that opens a subset of other items when clicked, I have only seen it in other applications I've used, and I can't find any resources on how to create it. Does anyone know how to?

Thanks.

My objective

rfsbraz
  • 2,101
  • 1
  • 18
  • 26

2 Answers2

1

Its not clear if you want to created Nested listviews that look like this

-Item1
-Item2
---Item2A
---Item2B
-Item3

or if you want to open a completely new list when the user clicks on an item.

If you want to use a nested listview look at this question: android nested listview

And if you want to open a new activity, then create a 2nd activity with a listview and open that on an item click

Community
  • 1
  • 1
slayton
  • 20,123
  • 10
  • 60
  • 89
0

Perhaps you should try to have a look at the ExpandableListView.

Documentation is available from here: http://developer.android.com/reference/android/widget/ExpandableListView.html

If you wanted to add a ListView that opens another list, you can do it in several ways. I've successfully done it by adding an OnItemClickListener to the ListView and then simply load a new set of data in the ListView and update it using invalidate() or by setting a new Adapter.

You could even add some cool transitions or animations, and create a listener for when the animation is completed. Lots of cool ideas :-)

Michell Bak
  • 13,182
  • 11
  • 64
  • 121