Dynamically build data for ExpandableListView
I'm using "ExpandableListView" in my application to display some options that . I need a way to build automatically the information to show when a group is expanded as the information might be different开发者_如何学JAVA each time the group is expanded.
My guess, your items should be different ( different objects and use different layout ) so once you expand a group, the getView in your adapter will display layout needed. If you expect that data in your items themselves changes and you need to update that - you need to notify your adapter ( notifyDataSetChanged ).
If you need something specific on group expended - there are callbacks in the adapter - http://developer.android.com/reference/android/widget/ExpandableListAdapter.html onGroupExpanded(int groupPosition)
精彩评论