tags:

views:

291

answers:

1

When I was debugging my application suddenly this error popup. How can I handle this kind of error?

I don't know where and how is caused.

Daemon System Thread [<5> HeapWorker] (Suspended (exception IllegalStateException)) 
    SQLiteCursor.finalize() line: 603   
    NativeStart.run() line: not available [native method]   
+1  A: 

Use managedQuery() function to query the data. If you use managedQuery() instead of query() then Activity will keep the reference of the Cursor and automatically close it when it is not used.

Karan
How can I locate the cursors that were not started by managedQuery?
Pentium10
I don't know about how to locate the cursors that were not started by managedQuery(). Btw you can call the startManagingCursor() (activity method) for all the cursors that you are accessing. It will make sure that the activity will handle all the cursor management.
Karan
If I use a Cursor locally, and I .close() it. Do I have to manage it?
Pentium10
Any Cursor opened and not passed to startManagingCursor() has to be closed by yourself. If you close() all your cursors, that error shouldn't show up under your PID.
Al