Skip to content

Instantly share code, notes, and snippets.

@moltak
Created April 11, 2014 11:05
Show Gist options
  • Save moltak/10458814 to your computer and use it in GitHub Desktop.
Save moltak/10458814 to your computer and use it in GitHub Desktop.
ExpandableListView in Scrollview
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.expandable, container, false);
ExpandableAdapter adapter = new ExpandableAdapter();
expandableListView.setAdapter(adapter);
setExpandableListViewHeight(expandableListView, -1);
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int position, long id) {
setExpandableListViewHeight(parent, position);
return false;
}
});
return view;
}
@zeynep-turker
Copy link

zeynep-turker commented Jun 6, 2024

I used this method on my extendedListView but at first unnecessary extra space remains in my activity. Then I clicked a group, and it fixed. How to fix this problem?

@zeynep-turker
Copy link

zeynep-turker commented Jun 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment