我正在尝试运行查询以从 SQLite 中的表中选择一个随机单词,但是当我尝试运行应用程序时出现此错误?
随机词法
public String randWord() {
SQLiteDatabase db = this.getWritableDatabase();
Cursor cur = db.rawQuery("SELECT * FROM TABLE_WORDS ORDER BY RANDOM() LIMIT 1",
new String[] { "*" }, null);
String word = cur.getString(cur.getColumnIndex(KEY_WORD));
return word;
}
尝试运行应用程序时收到此错误消息
01-07 14:46:24.448: E/AndroidRuntime(21664): FATAL EXCEPTION: main
01-07 14:46:24.448: E/AndroidRuntime(21664): java.lang.NoSuchMethodError:
android.database.sqlite.SQLiteDatabase.rawQuery