안드로이드 개발 질문/답변
(글 수 45,052)
SQLite manager를 사용해서 db를 만들었는데요..
실행하면 cursorIndexOufOfBoundsException: Index 0 requested, with size of 0 이렇게 뜨네요...
String[] columns = {"row_id", "english_word", "han_word"};
db.execSQL("Create Table IF NOT EXISTS word(row_id integer,english_id varchar, han_id varchar)");
cursor = db.rawQuery("select * from word", null);
Random random = new Random();
cursor.moveToLast();
int tempRandomNum = random.nextInt(1);
cursor.move(tempRandomNum);
cursor.moveToFirst();
word.setText(cursor.getString(2));
어디가 문제인지 도무지 알 수가 없습니다 ㅠㅠ 좀 알려주세요 ㅠ
실행하면 cursorIndexOufOfBoundsException: Index 0 requested, with size of 0 이렇게 뜨네요...
String[] columns = {"row_id", "english_word", "han_word"};
db.execSQL("Create Table IF NOT EXISTS word(row_id integer,english_id varchar, han_id varchar)");
cursor = db.rawQuery("select * from word", null);
Random random = new Random();
cursor.moveToLast();
int tempRandomNum = random.nextInt(1);
cursor.move(tempRandomNum);
cursor.moveToFirst();
word.setText(cursor.getString(2));
어디가 문제인지 도무지 알 수가 없습니다 ㅠㅠ 좀 알려주세요 ㅠ