close() was never explicitly called on databaseandroid.database.sqlite异常

ERROR/Database(3236): close() was never explicitly called on databaseandroid.database.sqlite.

DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here

它会产生一个异常提示,但程序是不会中止。

字面上理解是database没有正常关闭,实际是因为重复实例化了你的database,或者说你连接已经建立,而你又尝试打开另一个连接时才会有异常。所以解决的办法是,保证你只打开一次连接。

相关文章

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