0

I already have a ListView where each row contains two TextViews and a ImageView. But what I want to do now is to add number of ImageViews into my row. How can i do it? is it by using Nested listviews how to do it? and can i use the same id android:id="@android:id/list"

dinesh707
  • 12,106
  • 22
  • 84
  • 134
  • Use expandable listview for your purpose... – Bharat Sharma May 14 '12 at 12:04
  • simply i need to make something like this https://lh6.ggpht.com/6IdzucfF85DywfqkShiIonyWcEXyg9188pEi6qsYA0Y0sK4CE2LgkYk2TwiZzO8UXDM here the walking man, bus, metro images can be different and number of occurrences also differ. – dinesh707 May 14 '12 at 12:07

1 Answers1

0
  • You should either go for ExpandableListView, and add the TextViews to your parentView renderers, or
  • You can create your own renderer for the list, where each item is a View containing the two TextViews and a ListView.

Your inner ListViews can have any id attribute, since it does not need to be unique, and from the Adapter implementation you will always know exactly where you are (in the tree).

A sample implementation of a nested view can be found here.

Community
  • 1
  • 1
rekaszeru
  • 19,130
  • 7
  • 59
  • 73