When to close cursor in Android?
问题 I have an app that uses cursor to select data via rawQuery from a sqlite db to populate a ListView in Android;. Every time the user clicks on a listview item I create a new instance of Activity to re-populate listview. Is it better to call cursor.close() and db.close() to avoid memory problems? I actually have db.close() in OnDestroy() of my activity. 回答1: You can close the cursor once you have retrieved the values for that particular object inside your method. btw...You don't have to