Application did not close the cursor or database object that was opened here 异常

来源:互联网 发布:2017美国名校录取数据 编辑:程序博客网 时间:2024/05/21 06:26

今天在调用Android自带的sqlite数据库时,遇到了下面的异常

02-21 16:05:56.208: E/SQLiteDatabase(8789): close() was never explicitly called on database '/data/data/com.joyveb.tools/databases/lotteryTools.db' 

02-21 16:05:56.208: E/SQLiteDatabase(8789): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here


原因:

打开的数据库一直没有关闭,又重新打开使用。

解决办法:

调用SQLiteDatabase对象的close()方法进行关闭

0 0
原创粉丝点击