Java – simpleexpandablelistadapter and expandedgrouplayout
I'm trying to use simple expandable list adapter. I need different layouts, whether they are extended or not
There is a constructor that allows two layouts to be passed for a group:
I passed two different layouts, but only collapsedgrouplayout
Does anyone have this job?
thank you
resolvent:
I checked the source code of the simple expandable list adapter, and there seems to be a bug:
We can see that if convertview is not null, the "isexpanded" parameter will never be used if listview reuses its cells. Therefore, if the cells are visible and clicked, convertview will be reused as is and will never use other layouts
For me, a quick solution is to override getgroupview and pass null for convertview each time:
A better solution is to keep the group location and its status list, and do not reuse convertview if the status changes