kursor.moveToPosition(0);
btnNxt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RadioButton ans = (RadioButton) findViewById(rg.getCheckedRadioButtonId());
String anstxt = ans.getText().toString();
if (anstxt.equalsIgnoreCase(kursor.getString(5))) {
correct++;
} else {
wrong++;
}
wyniktxt.setText(String.valueOf(correct));
if (kursor.getPosition() >=9)
{
Intent a = new Intent(getApplicationContext(), lpodsumowanie.class);
a.putExtra("pkt",correct);
startActivity(a);
}
kursor.moveToNext();
tv.setText(kursor.getString(1));
rb1.setText(kursor.getString(2));
rb2.setText(kursor.getString(3));
rb3.setText(kursor.getString(4));
}
Powyższy kod wyrzuc mi błąd:
android.database.CursorIndexOutOfBoundsException: Index 10 requested, with a size of 10
Co jest źle?