I need to define the structure of ExpandableListView in xml file manually.
Is there any guide or example of doing this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I run into this two days ago. Here’s my solution:
First extend
ExpandableListActivityand override the onCreate() method like this:The definition of
BaseExpanableListAdapterExampleis (inner class ofExpandableExample):Then you need to implement
getChildViewandgetGroupView. What I did was:Then you need to define both
group_row.xmlandchild_row.xmlunder/res/layout/directory. For example, mygroup_row.xmlis as follows:Hope it helps. Comment if you have any question.