deptPopupWindow.setItemListener(new IOnItemSelectListener() {
@Override
public void onItemClick(int pos) {
if(pos>-1 && pos<deptmentList.size()){
// rlDept.setBackgroundResource(R.drawable.bg_lin2);
String value=deptmentList.get(pos);
tvDeptment.setText(value);
deptPos=pos;
list.clear();
clearOverlay();
//GetSurroundVehicleUtil util3=new GetSurroundVehicleUtil(SurroundVehicleActivity.this, progressDialog, list, handler);
GetSurroundVehicleUtil util3=new GetSurroundVehicleUtil(SurroundVehicleActivity.this, progressDialog, handler);
util3.setcalcuList(list);
util3.getSurroundVehicle(listVehicleStyle.get(postion).getId(), String.valueOf(lng), String.valueOf(lat), tvDistance.getText().toString().trim(),listDeptDepartmentEntries.get(deptPos).getId());
}
}
});
最后一行报错啊
String value=deptmentList.get(pos);是不是这一行报的啊?上面判断条件上应该是pos<deptmentList.size(),没有等于,list是从0开始取的,如果size为
1,那么你list.get(1)肯定是会报错的