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.
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
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 :-)