Close was never explicitly called

前端 未结 1 798
臣服心动
臣服心动 2021-01-14 16:49

I have a listview that is sourced by an sqlite db. I call fillData() at several different points to update the listview.

private void fillData() {
        mD         


        
相关标签:
1条回答
  • 2021-01-14 17:40

    If everything is in one Activity just open database and cursor in onCreate() and close in onDestroy(). Another option is to use singleton or smoething which will open database or cursor before operations if it's null.

    The erros are caused because if you are finishing operations on database you should close it.

    0 讨论(0)
提交回复
热议问题