passing cursor to another activity

Put your problem here if it does not fit any of the other categories.

passing cursor to another activity

Postby ayden » Fri Mar 13, 2009 10:33 am

I query database in activity A.
Now i want to pass the cursor to next activity B to show the results.
Is there a way to do that?
Thanks
ayden
Freshman
Freshman
 
Posts: 6
Joined: Fri Mar 06, 2009 10:56 am

Top

Postby MrSnowflake » Fri Mar 13, 2009 10:37 am

You can't. You can only pass Parcelable classes from one activity to another using intents. It also is a bad habit to pass Cursors, because they reference to the creating activity and thus you can leak that activity and fill up your memory for nothing.

Instead, you should pass the information needed to make the same query in the new activity.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests