我正在使用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();