CursorIndexOutOfBoundsException bład android studio

0
 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?

1

błąd mówi że pobierasz z kursora coś o id 10 podczas gdy kursor ma 10 elementów czyli indeksy 0-9

1 użytkowników online, w tym zalogowanych: 0, gości: 1