Finalizing a Cursor that has not been deactivated or closed non-fatal error

前端 未结 9 1470
慢半拍i
慢半拍i 2020-12-07 19:27

i\'m getting a \"Finalizing a Cursor that has not been deactivated or closed\" error on this piece of code. The code is used to fill a listview.

Since it\'s a non

9条回答
  •  庸人自扰
    2020-12-07 19:50

    I struggled with this problem for two days. I was trying to get sample code working which passed a cursor, returned from a database query, directly to List Adapter - no interim adapter. It refused to work - just displayed a blank screen - until I invoked 'moveToFirst()' on the cursor before passing it to the ListAdapter. Go figure! When I comment this out, it breaks.

    Just thought that I'd share this to save people the same struggles that I had.

    If anyone can shed some light on why this is so, I'd appreciate it. I haven't had to invoke moveToFirst on cursors up to now, to get them to perform properly.

提交回复
热议问题