开发者

How to Handle in code IllegalStateException on Cursor?

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   
    NativeSt开发者_Go百科art.run() line: not available [native method]   


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.


I had this same 2 line Exception and stack trace when using a SQLiteDatabase Cursor because I forgot to close the cursor after populating a local database structure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜