This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Leak Found Exception

 
yash wardhan
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

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?

Thanks in advance.
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Chrome Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you please please paste the code here?, so I can have more idea. I think its related with database. It might be remained opened at some point.

Thanks
Pratik Goswami.
 
yash wardhan
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pratik,

This is the code


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.
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Chrome Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try to deactivate cursor instead of closing it.


Thanks
Pratik Goswami
 
yash wardhan
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pratik,

Thanks for your reply.

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.

Anyone please tell the solution.


Thanks
 
yash wardhan
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any iputs please? Still couden't solve the problem.


Waiting for reply
 
yash wardhan
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ANy reply android experts, still getting the exception
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic