【发布时间】:2014-01-08 20:58:48
【问题描述】:
你好吗?
我需要你的帮助,我正在尝试使用 WS 的信息做一个 ExpandableListview,我得到第一个信息组,当我点击一个组项目时,我必须获取其他 Web 服务的信息并显示,我的问题是我如何刷新子列表并动态扩展信息?如果我之前只使用 GroupHeader 创建并显示 ExpandableList。
感谢您的关注,抱歉我的英语不好。
【问题讨论】:
标签: android expandablelistview
你好吗?
我需要你的帮助,我正在尝试使用 WS 的信息做一个 ExpandableListview,我得到第一个信息组,当我点击一个组项目时,我必须获取其他 Web 服务的信息并显示,我的问题是我如何刷新子列表并动态扩展信息?如果我之前只使用 GroupHeader 创建并显示 ExpandableList。
感谢您的关注,抱歉我的英语不好。
【问题讨论】:
标签: android expandablelistview
您需要使用新的组/孩子信息更新您的ListAdapter。假设您已经生成了一些 ExpandableListAdapter,您可以创建一个新的,然后在新数据可用时更新 ListView 的适配器:
private ExpandableListView mList;
private SimpleExpandableListAdapter mAdapter;
// assume you've already set up the data in the adapter as per the description
mAdapter = new SimpleExpandableListAdapter(
//... all of the fields to initialize, passing in the new children info ...
);
mList.setAdapter(mAdapter);
【讨论】: