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

前端 未结 9 1465
慢半拍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:53

    When a query returns a cursor it is actually positioned "before" the first record in the cursor. An adapter will attempt do a 'getItem' at the first element so it will fail as the cursor is not positioned at any.

    In my base adapters I do a cursorMoveToPosition on the getViews. This seems to eliminate the need for the movefirst.

提交回复
热议问题