column '_id' does not exist

错误提示如下:

java.lang.IllegalArgumentException: column '_id' does not exist

因为SimpleCursorAdapter的方法只识别_id,所以,当你用到sqlite的SimpleCursorAdapter时,必须把数据表的主键命名为_id。另外在newSimpleCursorAdapter时里面的用到的Cursor,如果是通过sqlitedatabase.query()方法获得,那么在query方法中参数String[] columns必须包含'_id'主键!

相关文章

SQLite架构简单,又有Json计算能力,有时会承担Json文件/RES...
使用Python操作内置数据库SQLite以及MySQL数据库。
破解微信数据库密码,用python导出微信聊天记录
(Unity)SQLite 是一个软件库,实现了自给自足的、无服务器...
安卓开发,利用SQLite实现登陆注册功能