-
-
Save moltak/10458814 to your computer and use it in GitHub Desktop.
@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; | |
} |
shobishani
commented
Sep 18, 2018
•
Please share me the setExpandableListViewHeight(expandableListView,-1) Method codes., Thanks in Advance
This works really fine below method
Perfectly Worked.
awesome, thank you!
Why use this line setExpandableListViewHeight(expandableListView, -1); ?
Because when I use this my ExpandabeListView is showing in scroll initially but it set normal when i expanded any item
remains lots of space before click on any group,after clicking everything ok
give me solution
Excelente lo de shobishani , me funciono al 100
I would only add after children loop
totalHeight += (listView.getDividerHeight() * (listAdapter.getChildrenCount(i) - 1));
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?
I solved it. You can use it.
https://gist.github.com/zeynep-turker/ee0f5917a4f230a8d1f424efa5834648