当前位置:   article > 正文

android 多界面光标,android.database.CursorWindowAllocationException:光标窗口分配2048 kb失败,即使关闭游标...

cursorwindowallocationexception

关于CursorWindowAllocatoinException有很多关于SO的问题:

他们都建议游标在使用后必须关闭.但这并没有解决我的问题.这是我的代码:

String query = "select serial from tbl1 union select serial from tbl2 union select serial from tbl3";

sqliteDatabase db = null;

Cursor cur = null;

try {

SettingsDatabaseHelper dal = new SettingsDatabaseHelper(

c);

db = dal.getReadableDatabase();

cur = db.rawQuery(query,null);

int numRows = cur.getCount();

if (numRows > 0) {

cur.moveToFirst();

int serialIdx = cur.getColumnIndexOrThrow("serial");

for (boolean hasItem = cur.moveToFirst(); hasItem; hasItem = cur

.moveToNext()) {

String serial = cur.getString(serialIdx);

if (Validator.getInstance().isValidSerial(serial))

serials.add(serial);

}

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/341387
推荐阅读
相关标签
  

闽ICP备14008679号