How to handle IllegalStateException code in Cursor?

When I suddenly debugged the application, this is an error popup. How can I deal with this error?

I do not know where and how it is caused.

Daemon System Thread [<5> HeapWorker] (Suspended (exception IllegalStateException)) 
    SQLiteCursor.finalize() line: 603   
    NativeStart.run() line: not available [native method]   
+3
source share
2 answers

Use the managedQuery () function to query data. If you use managedQuery () instead of query (), then Activity will save the link to the cursor and automatically close it when it is not used.

+5
source

I had the same 2 lines Exception and stack trace when using SQLiteDatabase Cursor, because I forgot to close the cursor after filling in the local database structure.

+1
source

Source: https://habr.com/ru/post/1735830/


All Articles