使用CursorTreeAdapter绑定游标cursor后

异常:
Android java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow.异常

java.lang.IllegalStateException: Couldn’t read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

方法:

百度后发现了很多类似的异常,Couldn’t read row 0, col -1 from CursorWindow

注意不同的是,此处为-1

搜到的很多说是查询的时候列名写错了,与数据库中的列名不一致(多一空格或少一空格)

仔细检查后,发现查询的语句并没有错

将手机的数据库.db文件导出,用软件工具打开,输入sql语句,也能正常查询

起初以为是CursorTreeAdapter使用错了

折腾了半天,最后发现数据库中存在一条超大数据,一个byte数组。
导致在使用CursorTreeAdapter绑定后,获取数据列时抛出异常

Android java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow.异常

相关文章:

  • 2022-12-23
  • 2022-02-13
  • 2021-11-01
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-10-02
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案