0
응용 프로그램이 실행되지 않습니다. 이 순환 적 발생결과 쿼리를 반환하는 db 메서드
04-05 21:29:09.570: E/AndroidRuntime(1069): Caused by: java.lang.IllegalArgumentException:
Cannot bind argument at index 1 because the index is out of range.
The statement has 0 parameters.
홈페이지 - 호출 방법
Cursor wow = db.trying("Gold");
text = (TextView) findViewById(R.id.textView13);
String quantity = wow.getString(0); //
text.setText(quantity);
DB 처리기 - 방법 당신이 이미 지정했다 쿼리에서
문제가public Cursor trying(String vg){
String q = "SELECT quantity FROM " + TABLE_CONTACTS + " WHERE name=" + "'" + vg +"'";
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(q, new String[] {vg});
if (cursor != null) {
cursor.moveToFirst();
}
return cursor;
}
왜 이전 질문에서이 오류를 참조하지 않고 다음 질문을 작성했는지 이해가 안됩니다. ext 주석. – Sajmon