I want to make an ExpandableListView
which should always be showing its children elements
even after clicking the header, and it should not collapse. How could I implement this concept?
Asked
Active
Viewed 958 times
0
-
Why are you using `ExpandableListView` in this case? Just use a regular `ListView`, with different row layouts for the "children" to suggest that they are children (e.g., contents indented). – CommonsWare Jul 15 '14 at 11:57
-
for(int i=0;i
– Abhimanyu Jul 15 '14 at 12:47 -
and in oncreatelistView.setOnGroupCollapseListener(new OnGroupCollapseListener() { @Override public void onGroupCollapse(int groupPosition) { // TODO Auto-generated method stub listView.expandGroup(groupPosition); } }); – Abhimanyu Jul 15 '14 at 12:48
1 Answers
1
you can expand all groups one by one as below as mentioned in this post
ExpandableListView explst;
explst.expandGroup(0);
explst.expandGroup(1);
for disabling collapse you can define a OnGroupClickListener which returns true, like so: (as mentioned in this post)
explst.setOnGroupClickListener(new OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
return true; // This way the expander cannot be collapsed
}
});

Community
- 1
- 1

Rajen Raiyarela
- 5,526
- 4
- 21
- 41