Invalid statement in fillWindow()

2019-08-08 07:45发布

问题:

Am I missing a close()?

Ok, I have an error on my emulator, but it doesn't force close. It's a cursor Invalid Starement in fillWindow() with a PID of 651. I know it has to do wih my database cursor. My ListView is filled by startManagingCursor(c), but I'm not sure If I need to close it, I'm not using a managed query.

In my onCreate I have

db = new DBase(this);
db.open();
fillData();
db.close();

and in my onResume I have

db.open();
fillData();
db.close();

I've tried putting db.close(); in my onDestroy and it still throws that error.

回答1:

onCreate

db = new DBase(this);
db.open();
fillData();

onResume

fillData();

onDestroy

db.close();

worked.