java.lang.IllegalStateException: get field slot from row 0 col -1 failed 异常错误

来源:互联网 发布:检查ip端口是否打开 编辑:程序博客网 时间:2024/06/05 00:48

用游标迭代数据时,出现此异常:

java.lang.IllegalStateException: get field slot from row 0 col -1 failed

 


原因有可能如下:

1,检查查询的字段名是否写错

2,   检查游标是否查询出你所需要的字段

3.cursor的使用

public Cursor getChildCursor(int groupId){
        try {
            SQLiteDatabase db = open();
            return db.query("table"+groupId, null, null, null, null, null, null);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

int groupId = groupCursor.getInt(groupCursor.getColumnIndex("_id"));



0 0