I have an activity in which I am showing data in list format. The input for the list is comming from DB and I am using my own adapter class which extends SimpleCursorAdapter.
I am retrieving cursor from db class but I haven't closed the cursor myself, rather I have passed this cursor to startManagingSursor(), so I guess this will handle the closing cursor part. But when I am going to new activity from my ListActivity, I am getting Leak Found Exception.
Can any one please tell me how can I fix this?
I tried closing the cursor in my getView() as last statement but then I am not able to see the list, it is showing the blank screen.
And closing it at the end of the above code gives some other exception.
I tried your suggession but it is also not working.
Rather it is not showing the list itself. However, when I checked the logs, I can see the correct number of records fetched from DB.
When I deactivate the cursor in ListActivity class, I am getting empty message that I set in layout.xml for list and when I deactivate it in my adapter class's getView() it is not showing anything not even empty message.