簡體   English   中英

如何在ExpandableListview中添加子項

[英]How to Add Child in ExpandableListview

你好嗎?

我需要您的幫助,我正在嘗試使用WS信息進行ExpandableListview,我獲得了第一個信息組,當我單擊“組的項目”時,我必須獲取其他Web服務的信息並顯示,我的問題是刷新“子級”列表,並展開信息dynamicallt?。 如果我僅使用GroupHeader創建並顯示ExpandableList。

感謝您的關注,對不起我的英語不好。

您將需要使用新的組/兒童信息更新ListAdapter 假設您已經生成了一些ExpandableListAdapter ,則可以創建一個新的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);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM