Android SQLiteMisuseException when calling database.rawQuery

I use the SQLite database in an Android application and sometimes get a SQLiteMisuseException when calling database.rawQuery (String sql, String [] selectionArgs). This is rather strange because this exception appears ramdomly, and I really don't know why.

More details about the exception:

android.database.sqlite.SQLiteMisuseException: library routine called out of sequence: , while compiling: SELECT PromoGuid, PromoViewCount FROM TablePromoView at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method) at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92) at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83) at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49) at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42) at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1356) at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1324) at com.my.application.... 

Has anyone had this mistake? Can you help me solve this problem?

Thanks in advance,

PS: Sorry for my poor English, I'm from Belgium.

+7
source share
1 answer

check out this link . Be sure to close any open db / cursors connection before starting another action, etc.

0
source

All Articles