开发者

Dynamically build data for ExpandableListView

开发者 https://www.devze.com 2022-12-28 19:24 出处:网络
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 diff

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消