1

I'm in this situation that i need a list of lists.

for instance i want to display a list of departments and in these departments there are employees:

Dep 1:

Employee 1
...
Employee N-1

Dep ...

Dep N - 1:

Employee 1
...
Employee N-1

any idea how to make this? (sorry for the bad english)

lamaen
  • 15
  • 5
  • See [this question](http://stackoverflow.com/questions/1013765/creating-categories-in-a-listview) and [this one](http://stackoverflow.com/questions/4545315/how-to-create-listview-with-categories-segments) – Ted Hopp Mar 25 '12 at 15:48

4 Answers4

1

what you need is custom list adapter or you can use ExpandableListView widget.

Asdfg
  • 11,362
  • 24
  • 98
  • 175
1

You should try this by implementing an Expandable ListView.. Refer this link

5hssba
  • 8,079
  • 2
  • 33
  • 35
1

are you talking about an android ListView inside another listview

read about custom list adapter.. and find there you can paas list of departments in there..which would populate single view in getView() as list(custom list adapter by passing employees list) of employees in it.... but make sure if this flow on user screen will be acceptable to you or not...i.e. list view inside a list view... might be little confusing from user's perspective

Rahul garg
  • 9,202
  • 5
  • 34
  • 67
1
  1. you can have a list with your departments and if one of the departments is clicked you just open a new Activity/show a new Fragment with the corresponding list of employees.

  2. try an expandable listview, there is a good example in the api-demos

hoeggi
  • 125
  • 2