この例外が発生しています:
06-09 13:14:41.917: E/AndroidRuntime(630): java.util.ConcurrentModificationException
06-09 13:14:41.917: E/AndroidRuntime(630): at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
私は以下を使用しますEndlessAdapter
:
private class DemoAdapter extends EndlessAdapter {
private RotateAnimation rotate=null;
DemoAdapter(ArrayList<Outlets> outletList) {
super(new OutletListAdapter(VerticalsListActivity.this, outletList));
rotate=new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
rotate.setDuration(600);
rotate.setRepeatMode(Animation.RESTART);
rotate.setRepeatCount(Animation.INFINITE);
}
@Override
protected View getPendingView(ViewGroup parent) {
View row=getLayoutInflater().inflate(R.layout.row, null);
View child=row.findViewById(android.R.id.text1);
child.setVisibility(View.GONE);
child=row.findViewById(R.id.throbber);
child.setVisibility(View.VISIBLE);
child.startAnimation(rotate);
return(row);
}
@Override
protected boolean cacheInBackground() throws Exception {
// TODO Auto-generated method stub
if(isMoreLoading){
try {
if(Project.isFilterEnabled){
getDownloadedData = (FetchAndParseData) new FetchAndParseData().execute(Project.searchUrl+"/pageno/"+ ++i);
}else{
getDownloadedData = (FetchAndParseData) new FetchAndParseData().execute(UrlConstants.OUTLETS_INFO_URL+Project.currentCityId+"/pageno/"+ ++i+"/verticalid/1");
}
inputStream = getDownloadedData.get();
XmlUtilities.parseAndLoadData(inputStream , mOutletXmlHandler);
outletList = Project.getOutletList();//Project.getOutletList();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return isMoreLoading;
}
@Override
protected void appendCachedData() {
// TODO Auto-generated method stub
adptr = (OutletListAdapter) getWrappedAdapter();
if(outletList.size()==20){
isMoreLoading=true;
}else{
isMoreLoading=false;
}
if(outletList!=null){
for (Outlets addThis : outletList) {
adptr.add(addThis);
}
}
}
}
現在、リストに含まれる要素が 20 未満で、そのリストをスクロールすると、前述の例外がスローされます。私は何が間違っていますか?