New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the OnItemExpandCollapseListener not work! #100
Comments
Same problem here. The listener is |
Ok, I think I got it. In SlideExpandableListView.java line 44 a new
But in code:
Basically our custom This is a major issue in my opinion. If you think about it, the list adapter is wrapped two times with no reason at all. We should change the code (i.e. assigning the I'm ready to provide a pull request, but there's a choice to be made, and it must be made by @tjerkw |
Hi @lorenzos could you please show us the solution? I can't figure out how to resolve this issue. |
I didn't provide a pull request because I proposed two solutions that work both, but are different in architecture. I was waiting for a reply by @tjerkw on which is its favourite, and then I forgot this at all. First proposed solutionRemove both the public void setAdapter(SlideExpandableListAdapter adapter) {
this.adapter = adapter;
super.setAdapter(this.adapter);
} Second proposed solutionIf I remeber well, I ended up chosing this one. public SlideExpandableListAdapter getSlideExpandableListAdapter() {
return adapter;
} Change the setup code in your application from: list.setAdapter(new SlideExpandableListAdapter(adapter, ...)); To: list.setAdapter(adapter, ...); Now, when you want to attach the listener, you do on it the instance returned by the new method, not on your original adapter: list.getSlideExpandableListAdapter().setItemExpandCollapseListener(...) |
I want to change the icon of the toggleButton when I click the btn.So I set a OnItemExpandCollapseListener on the SlideExpandableListAdapter,but not work. When I debug,the listener is null.Why?
The text was updated successfully, but these errors were encountered: