android开发,sqlite中Index -1 requested,with a size of XXX 问题的修复
来源:互联网 发布:云计算培训多诈骗 编辑:程序博客网 时间:2024/06/07 14:48
在android开发中,如果我们需要读取表中的某一字段的数据的话,往往使用一个数据库的游标cursor来自上而下的遍历读取,读的时候,为了确保表不为空,我们可以调用cursor的getCount方法来,如果值不为0,代表表不为空,这时候,开发者们往往再判断完表是否为空之后,直接按照字段读数据,运行时会报类似于这样的错误:
Index -1 requested,with a size of XXX
原因是因为调用getCount方法后,cursor就游到表的末尾了,只要在按字段读取数据的代码前面,调用一下cursor的moveToFirst方法即可决绝,将游标重新挪到表的首位。
- android开发,sqlite中Index -1 requested,with a size of XXX 问题的修复
- Android开发7——android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
- Android开发:报错Index -1 requested, with a size of 1
- Android开发:报错Index -1 requested, with a size of 1
- android开发报错:Index -1 requested, with a size of 6
- 【我的问题】关于cursor查询的用法的注意事项(Index -1 requested, with a size of 1)
- android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsExcept: Index -1 requested, with a size of 1
- android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 0
- android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 3
- Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2
- qlite操作时出现下面错误 android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of
- zigbee协议栈 中断服务函数定义方法
- SD-如何根据销售单位确认数量,避免出现小数确认数量
- 遇到的问题-------------------MSSQLSERVER服务无法启动的解决方案
- 如何记录受保护视频
- 第四部分 个人理财风险防范11.提防网络陷阱
- android开发,sqlite中Index -1 requested,with a size of XXX 问题的修复
- Hadoop回收站trash
- 多线程--内核对象和句柄泄露&CloseHandle
- browser css
- Eclipse导入在svn中的项目问题
- Mysql配置Spring数据源c3p0与dbcp
- java rmi远程方法调用
- 关于SIGPIPE信号
- 2013年4月IT行业网站综合影响力排名