调用database.rawQuery当Android的SQLiteMisuseException [英] Android SQLiteMisuseException when calling database.rawQuery

查看:255
本文介绍了调用database.rawQuery当Android的SQLiteMisuseException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android应用程序中使用SQLite数据库,并呼吁database.rawQuery时,有时会得到一个SQLiteMisuseException(SQL字符串,字符串[] selectionArgs两个)。
这是pretty奇怪,因为这个异常ramdomly出现,我真的不知道为什么。

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

有大约异常更多的信息:

There is more informations 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....

是否有人有这个错误?你能帮我解决这个问题?

Does somebody had this error? Can you help me to solve it?

由于提前,

PS:对不起,我的英文不好,我从比利时是

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

推荐答案

<一个href=\"http://stackoverflow.com/questions/4820556/sqlite-exception-on-resuming-android-activity\">check此链接。确保关闭所有打开的数据库连接/在你面前光标开始另一个活动,等等。

check this link. Make sure to close any open db connection/cursors before you starting another activity, etc.

这篇关于调用database.rawQuery当Android的SQLiteMisuseException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆