android.database.CursorWindowAllocationException-游标已关闭
DB游标抛出异常,表示游标已打开,但每次都关闭。是退货单把事情搞砸了吗android.database.CursorWindowAllocationException-游标已关闭,android,android-sqlite,android-cursor,Android,Android Sqlite,Android Cursor,DB游标抛出异常,表示游标已打开,但每次都关闭。是退货单把事情搞砸了吗 public long getValue() { long val = 0; Cursor cursor = null; try { if (db != null) { cursor = db.query(*****); if (cursor.moveToFirst()) {
public long getValue() {
long val = 0;
Cursor cursor = null;
try {
if (db != null) {
cursor = db.query(*****);
if (cursor.moveToFirst()) {
return cursor.getLong(cursor.getColumnIndex(****));
}
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return val;
}
获取以下异常:
android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=1 (# cursors opened by this proc=1)
您的游标中有太多的数据,比如像图像数据这样的二进制内容。但为什么它会显示open cursor?我知道前面的游标是打开的,只是游标中有太多的数据,比如像图像数据这样的二进制内容。但为什么它会说打开游标呢?打开游标,因为我知道前面的游标是打开的