0

I have a problem with lists.

I want to implement a scrollable big list, each element of which contains a text on the left side and a NON-scrollable inner list on the right side. (for example: the name of the flat and the list of its inhabitants names)

enter image description here

Both lists should be filled from the cursors and contain an informatio about them: I want to have an oppurtunitz to get all cursos fields when I click an element of the inner list.

As far as I understood I's not possible to solve it with two ListViews. ExpandableListView does not pass me because I do not want to expand the first list, I want to have the inner list always visible.

Do you have any ideas how can I realize it?

user2957954
  • 1,221
  • 2
  • 18
  • 39

1 Answers1

1

Try using a ListView for your big list, and an empty LinearLayout in each item. You fill the LinearLayout of each item programmatically in the big list adapters getView(..) method, where int position is the item number. See also: android nested listview

Edit: Or use an ExpandableListView, which items you expand programmatically without animation with expandGroup(int position, boolean animate). Prevent collapsing by setting an ExpandableListView.OnGroupCollapseListener, in which you expand the group again. (seems a bit hacky)

Dokumentation: https://developer.android.com/reference/android/widget/ExpandableListView.html

Community
  • 1
  • 1
Lucker10
  • 474
  • 5
  • 16