Android: Send arbitrary objects within Activities?

Posted by Sebastian on Stack Overflow See other posts from Stack Overflow or by Sebastian
Published on 2010-03-27T19:44:55Z Indexed on 2010/03/27 19:53 UTC
Read the original article Hit count: 261

Filed under:

I have read some question here but I didn't find a solution. I have read about Parcelable, Intents, and sharing specific data within Activities from the android dev docs (both dev guide and reference).

Here's the scenario:

I have one ListActivity that fills in an object parsing an xml file, it shows a list of values, and when clicked I want to return the object that represents the item clicked to the activity that has called it, for then, call another activity with this object.

I read on how to implement Parcelable but seems not being the way. Implementing Parcelable receives a Parcel for the constructor and then reads the values from it (or at least that was what I understood). This makes no sense for me and I can't see how to implement basing on that issue. I build the object parsing the xml file, not having a Parcel.

I appreciate some clarifications on this, regards.

© Stack Overflow or respective owner

Related posts about android