0

c.getString(i+2)動作しません。これらのコードで何かを見逃していますか?

エラー :java.lang.IllegalStateException: get field slot from row 0 col 13 failed

...

static String [] lesson_value;
    String query = "SELECT id, tag, lesson1, lesson2, lesson3, lesson4, lesson5," +
                    " lesson6, lesson7, lesson8, lesson9, lesson10,lesson11 " +
                    "from mytable order by id DESC limit 1";
            Cursor c = db.rawQuery(query,null);
            if (c != null && c.moveToFirst()) {
                    for(int i=0; i<12; i++) {
                 if ( c.getString(i+2) != null ) {
                     lesson_value[i] = c.getString(i+2);
}
}
4

1 に答える 1