在运行时添加组头:可扩展列表查看android

时间:2015-03-12 22:21:56

标签: android runtime expandablelistview

我正在使用android expandablelistview。最初它有5个组头和子项。在运行时根据选择,我想再向expListView添加一个标题/组。

我尝试更新这些值并调用BaseExpandableListAdapter方法notifyDataSetChanged。但是在运行时没有任何事情发生。

static HashMap<String,List<String>> mapSubCat;

And mapSubCat is filled with initial data.

exQuestLV = (ExpandableListView)findViewById(R.id.expandableListView);

expQuesListAdapter = new ExpandableListAdapter(this,arrCategories,mapSubCat);
exQuestLV.setAdapter(expQuesListAdapter);


//Adding data to mapSubCat based on selection: 

mapSubCat.put("Sport Name", arrSubSports);

expQuesListAdapter.notifyDataSetChanged();
expQuesListAdapter.notifyDataSetInvalidated();

0 个答案:

没有答案