在 Android 中使用 SQLiteCursor 时,我知道getColumnIndex()的行为区分大小写,例如:
例子:
DB中的列名是:规则
cursor.getColumnIndex("Rules") //works fine
cursor.getColumnIndex("rules") //throws error, see the error detail
文档对此只字未提,有关详细信息, 请参阅this。
LogCat 说:
java.lang.IllegalStateException:无法从 CursorWindow 读取第 0 行 col -1。确保在从光标访问数据之前正确初始化光标
我对这种行为感到困惑SQLiteCursor
,有人可以帮我确定这是真的还是我做错了什么?如果需要,我可以提供代码。
谢谢。