我在一台设备上收到此错误,而它在另一台设备上运行良好。这是错误:
Caused by: android.database.sqlite.SQLiteException: not an error
at android.database.sqlite.SQLiteQuery.nativeFillWindow(Native Method)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:86)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:164)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
at com.Orange.MakeVisits.Themes.onCreate(Themes.java:162)
我执行一个查询,并在检查 Cursor 是否为空的那一行,我得到了这个错误。这是我的代码:
String stmtGetThemes = "SELECT * FROM pr_fields_descriptor a "
+ "inner join pr_fields_starring b on a.id_fields_descriptor = b.fields_descriptor_id "
+ "where b.starring_id = '"+pos_starring_id+"' and a.theme_id='"+themes_ids[m]+"' order by form_rank";
Cursor getThemesCursor1 = db.databaseQuery(stmtGetThemes);
if (getThemesCursor1!=null && getThemesCursor1.getCount()>0){
//----
}
和 databasequery 是这个方法(在扩展类中定义SQLiteOpenHelper
):
public Cursor databaseQuery(String stmt) {
Cursor cursor = db.rawQuery(stmt, null);
return cursor;
}
知道什么会导致此错误吗?说法不好吗?为什么它适用于其他设备?欢迎任何想法。预先感谢。