使索引超出范围异常
for (int recordData = 0; recordData < recordDataList.size(); recordData++)
{
RecordData nextRecordData = recordDataList.get(recordData + 1);
if (nextRecordData.getRespondentId() !=
recordDataList.get(recordData).getRespondentId()) {
rowDataNumber++;
}
}
这里的大小是 3。但我还需要将第三个数据与第二个数据进行比较。我修改了我的喜欢
for (int i = 1; i < recordDataList.size(); i++) {
RecordData recordData = recordDataList.get(i - 1);
RecordData nextRecordData = recordDataList.get(i);
commentData = recordData.getCommentText();
if (nextRecordData.getRespondentId() != recordData
.getRespondentId()) {
rowDataNumber++;
}
}
大小是三,我只得到commentData 中的前两个数据,第三个数据没有显示。