android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or da
来源:互联网 发布:direct是什么软件 编辑:程序博客网 时间:2024/05/16 18:50
这个异常的抛出并没有让程序崩溃。
这些异常信息来源于SQLiteDatabase类的finalize方法。从异常的信息"close() was never explicitly called on database ,Application did not close the cursor or database object that was opened here
"可以知道这是由于程序中使用到的游标或SQLiteDatabase对象没有close所导致。也就是说在程序中创建的Cursor对象或者SQLiteDatabase对象,在使用完后没有关闭,而当它们都变成“垃圾"被GC时,就会打出以上的信息。
- @Override
- protected void finalize() {
- if (isOpen()) {
- Log.e(TAG, "close() was never explicitly called on database '" +
- mPath + "' ", mStackTrace);
- closeClosable();
- onAllReferencesReleased();
- }
- }
所以要想不发生这样的错误,在编码时一定要记住,当你不在使用Cursor或SQLiteDatabase对象时,将它们close(),
- android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or da
- android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or da
- Application did not close the cursor or database object that was opened here 异常
- Exit the Android application or Close all the Android ativities
- 07-09 03:16:08.655: E/Database(426): android.database.sqlite.DatabaseObjectNotClosedException: Appli
- android.database.sqlite.databaseobjectnotclosedexception:应用程序没有关闭的光标或数据库对象
- android.database.sqlite.databaseobjectnotclosedexception:应用程序没有关闭的光标或数据库对象
- Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: file is encrypted or is not a dat
- Android SQLite - close() was never explicitly called on database
- android SQLite :close() was never explicitly called on database 'XXXXXX'
- Caused by: android.database.StaleDataException: Attempted to access a cursor after it has been close
- Should I design the application or model (database) first?
- Android C#开发--The 'XamarinShellPackage' package did not load correctly
- Db2 client上load from cursor报错SQL1013N The database name .. could not be found
- "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler."的解决办法
- DevExpress Exception Solution - The target "X" for the callback could not be found or did not implement ICallbackEventHandler
- The origin server did not find a current representation for the target resource or is not willing to
- The origin server did not find a current representation for the target resource or is not willing to
- 软件需求包括3个不同的层次 - 业务需求、用户需求和功能需求
- Sprite to UIImage
- 从空项目建立手机端的DLL项目
- 我在学校一个多月来的总结
- 变化
- android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or da
- 液晶屏接口的分类及相关知识
- 创建和使用DLL动态库
- 图形视图框架(The QGraphics View Framework)
- Spring注解详细解析
- redhat主子进程示例
- 持续交付的8条原则
- SQL Server 与 Oracle 语句实现方式差异总结
- 专题:JQuery从入门到精通