입니다 :이 코드는 내 Adapter
에 배치하고 ListView
을 조정한다안드로이드 : java.lang.IndexOutOfBoundsException : 잘못된 인덱스 (9), 크기는 내 다음 코드에 문제가 있어요 9
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick (View v) {
int row = position +1;
int listLength = data.size();
HashMap<String,String> nextRow = data.get(position+1);
if (row < listLength) {
nextRow.put("greyedOut","false");
} else {
System.out.println("HATSIKIDEE!!");
}
notifyDataSetChanged();
System.out.println(row);
System.out.println(listLength);
}
});
를, 그것은 작동 모든 행에 대한하지만, 다음과 같은 오류를 반환 마지막 행을 선택할 때 충돌 : java.lang.IndexOutOfBoundsException: Invalid index 9, size is 9
내가 이해하지 못하는 것은에서 System.out.println()의 출력이 if 문에 따라된다는 점이다 :
1 of 9
2 of 9
3 of 9
4 of 9
5 of 9
6 of 9
7 of 9
8 of 9
At 9 of 9 it crashes.
Please help me how to solve this error.
위대한 !! 그것은 일했다!! 감사! – iJar