What adapter to use for ExpandableListView with non-TextView views?
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-04-02T17:24:30Z
Indexed on
2010/04/16
9:13 UTC
Read the original article
Hit count: 302
android
I have an ExpandableListView in which I'd like to have controls other than TextView. Apparently, SimpleExandableListViewAdapter assumes all the controls are TextViews. A cast exception is generated if they are not.
What is the recommended solution?
Options I can think of include: - Use some other included adapter. But I can't tell if they all have the same assumption. - Create my own adapter. Is there a doc which describes the contract, ie the sequence of method calls an adapter will encounter?
I expected the existing adapters to require the views to conform to some interface to allow any conforming view to be used, rather than hardcode to textview and limit where they can be used.
© Stack Overflow or respective owner