开发者

How to avoid DatabaseObjectNotClosedException?

开发者 https://www.devze.com 2023-02-06 03:25 出处:网络
01-24 12:17:10.780: ERROR/Database(462): close() was never explicitly called on database \'/data/data/com.test/databases/testdb7.db\'

01-24 12:17:10.780: ERROR/Database(462): close() was never explicitly called on database '/data/data/com.test/databases/testdb7.db'

01-开发者_运维百科24 12:17:10.780: ERROR/Database(462): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here


I resolved the exception. I was calling

 db = eventsData.getReadableDatabase(); 

twice thats why the exception is thrown


You must close your cursors.

You will find similar question here: databaseobjectnotclosedexception-how-can-we-avoid-this-exception also here: how-to-avoid-this-message-in-android

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消