As part of learning android, I am following the NotePad tutorial
One thing I noticed in the tutorials, the DB connection isn't being closed explicitly and it makes sense since startManagingCursor() handles it itself.
But if start/stop the app in a speedy manner (I manually started app by clicking it's icon and closed it by pressing back) I noticed DB wasn't getting closed & the following error was getting generated:
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
Closing the DB connection explicitly in onDestroy resolved the issue, but I guess this shouldn't have happened. Is it ok ?