(问题由一个问题编辑OP回答。转换为社区维基答案。见Question with no answers, but issue solved in the comments (or extended in chat))
的OP写道:
我解决了这个问题。我的代码是:
public News getNewsWithID(int id){
Cursor c = bdd.query(TABLE_NEWS, new String[] {COL_ID, COL_ASSO, COL_DATE, COL_HEURE, COL_TYPE, COL_TITRE, COL_CONTENU, COL_SERVEURID}, COL_ID +"='"+ id +"'" , null, null, null, null);
return cursorToNews(c);
}
我改成:
public News getNewsWithID(int id){
Cursor c = bdd.query(TABLE_NEWS, new String[] {COL_ID, COL_ASSO, COL_DATE, COL_HEURE, COL_TYPE, COL_TITRE, COL_CONTENU, COL_SERVEURID}, COL_ID +"='"+ id +"'" , null, null, null, null);
News temp = cursorToNews(c);
c.close();
return temp;
}
我认为游标被关闭的onDestroy()。
更多的代码会有帮助...错误消息似乎表明您正在打开大量的游标。 – Barak 2012-04-10 04:09:46