(問題由一個問題編輯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