@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
ArrayList<DrugsInfo> filteredList = (ArrayList<DrugsInfo>) results.values;
if(results != null && results.count > 0) {
clear();
for (DrugsInfo c : filteredList) {
add(c);
}
notifyDataSetChanged();
}
}
};
我在这里得到一个Concurrent Modification异常.Plz建议如何解决..
答案 0 :(得分:0)
因此,您需要使用迭代器(因为我无法看到整个代码):
for (Iterator<DrugsInfo> it = filteredList.iterator(); it.hasNext(); ) {
DrugsInfo c = it.next();
add(c)
}