I am updating the expandable list very often with new data, in addition I keep my 1 group open at a time. but when I update the data, the expanded group only shows first child item instead there should be more. I check the childCount and all, which are more then the number of views. The views are there but with not updated values check the img below. It only happens in somecases
here is my code of updating the adapter with new data.
if(!lastGroup.equals("NA")){
ArrayList<property> temp = new ArrayList<property>();
ArrayList<property> temp1 = new ArrayList<property>();
allDataChild = new ConcurrentHashMap<property, ArrayList<property>>();
for(int i = 0; i < data.size(); i++){
for (Map.Entry<property, ArrayList<property>> map : expanHash.entrySet()) {
if (data.size() > 0)
{
if (map.getKey().equals(data.get(i)))
{
if(data.get(i).type.equals(lastGroup))
{
temp.add(data.get(i));
temp1.addAll(removeDuplicates(map.getValue(), data.get(i).type));
}
}
}
}
}
for(int j = 0; j < temp1.size(); j++) {
if (temp1 != null && temp1.size() > 0)
Log.d(TAG, "map.value " + temp1.get(j).ssid);
}
allDataChild.put(temp.get(0), temp1);
info_panel = new ![ListAdapter][2](this, temp, allDataChild, false);
list.setAdapter(info_panel);
info_panel.notifyDataSetChanged();
any hints
0 comments:
Post a Comment