Android startManagingCursor()速度慢吗?

Android startManagingCursor()速度慢吗?,android,android-activity,cursor,Android,Android Activity,Cursor,作为学习android的一部分,我遵循 我在教程中注意到,DB连接没有显式关闭,这很有意义,因为startManagingCursor()自己处理它 但是,如果快速启动/停止应用程序(我通过单击图标手动启动应用程序,然后通过按“上一步”将其关闭),我注意到DB没有关闭&生成了以下错误: 08-23 18:11:55.637: WARN/SQLiteCompiledSql(10784): Releasing statement in a finalizer. Please ensure that

作为学习android的一部分,我遵循

我在教程中注意到,DB连接没有显式关闭,这很有意义,因为startManagingCursor()自己处理它

但是,如果快速启动/停止应用程序(我通过单击图标手动启动应用程序,然后通过按“上一步”将其关闭),我注意到DB没有关闭&生成了以下错误:

08-23 18:11:55.637: WARN/SQLiteCompiledSql(10784): Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: SELECT _id, title, body FROM notes
08-23 18:11:55.637: WARN/SQLiteCompiledSql(10784): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here

在onDestroy中显式关闭DB连接解决了这个问题,但我想这不应该发生。可以吗?

我认为这是一个无效的问题,因为它涉及两个不同的概念。Cursor和SQLiteOpenHelper实例不同,应该分别关闭。当我们使用startManagingCursor()时,游标实例是关闭的,但我们需要手动关闭SQLiteOpenHelper实例,我在onDestroy()中就是这么做的

我通过不关闭SQLiteOpenHelper实例来测试这一点,并使用startManagingCursor()来验证错误,我得到了它。即使关闭SQLiteOpenHelper实例而不关闭游标实例(如果未使用startManagingCursor()),也可能导致此错误