今天在调用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()方法进行关闭