Finalizing a Cursor that has not been deactivated or closed


Hi guys!

I’m using sqlcipher with content provider in Android. But when I do a query like mOpenHelper.getWritableDatabase(PASSWORD).query(). I receive the exception:

12-14 18:33:56.875 5025-5041/ E/Cursor: Finalizing a Cursor that has not been deactivated or closed. database = /data/data/, table = network, query = SELECT _id, status, type, latitude, longitude, password, registrationDate, ssid, user FROM network W
                                                                                net.sqlcipher.database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
                                                                                    at net.sqlcipher.database.SQLiteCursor.<init>(
                                                                                    at net.sqlcipher.database.SQLiteDirectCursorDriver.query(
                                                                                    at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(
                                                                                    at net.sqlcipher.database.SQLiteDatabase.queryWithFactory(
                                                                                    at net.sqlcipher.database.SQLiteDatabase.query(
                                                                                    at net.sqlcipher.database.SQLiteDatabase.query(
                                                                                    at android.content.ContentProvider.query(
                                                                                    at android.content.ContentProvider$Transport.query(
                                                                                    at android.content.ContentResolver.query(
                                                                                    at android.content.ContentResolver.query(
                                                                                    at$zzb.handleMessage(Unknown Source)
                                                                                    at android.os.Handler.dispatchMessage(
                                                                                    at android.os.Looper.loop(
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at java.lang.reflect.Method.invoke(


Hi @Adalberto_Fernandes

Are you able to recreate the issue within the SQLCipher for Android test suite?


Hi @developernotes.

Thank you! I had to close some cursors in my application.


Hello @Adalberto_Fernandes

Thank you for getting back to us, we are glad to hear you were able to resolve the issue. Take care!