1

I want to ask one question, should I use ListView inside ListView item? Or I should redesign and remake my idea?

Example of ListView, but should be with couple sub items:

Example of ListView, but should be with couple sub items

Jonas Czech
  • 12,018
  • 6
  • 44
  • 65
Airat
  • 80
  • 1
  • 8
  • Check this: http://stackoverflow.com/questions/28429906/how-to-add-multiple-custom-linearlayouts-programmatically-to-listview-item – Jonas Czech Mar 07 '16 at 08:38
  • This is exactly what I am looking for, but will it work fine with clickable items inside? – Airat Mar 07 '16 at 12:44
  • It should do. Let me know if it doesn't (maybe with a new question), and I'll try to help. Check [Android: ListView elements with multiple clickable buttons](http://stackoverflow.com/q/1709166) for for a rough idea of how to wire up the click listener. – Jonas Czech Mar 07 '16 at 12:51
  • Thank you, I'll try to combine both links. – Airat Mar 07 '16 at 12:53

2 Answers2

0

A ListView will never work correctly embedded as an item in another ListView. In fact, scrolling things inside other scrolling things is almost never what you really want to do, as it would be confusing to the user how to actually navigate your screen.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
0

A ListView inside a ListView item is never a good idea. If you want sublists inside your list you can, for example, use a ExpandableListView. However, with the migration from ListViews to RecyclerViews I would recommend you go and implement this instead.

Niels Masdorp
  • 2,534
  • 2
  • 18
  • 31
  • I wanted to use ExpandableListView, but I don't know can Iinsert items without subitems. – Airat Mar 06 '16 at 23:38