views:

98

answers:

1

I'm developing an app which basically navigates through a xml-feed. When I parse the feed or let's say the list, then each (list)item becomes a model. All the models are wrapped up in an array list.

Now, when the user clicks on a list item, the underlying model is going to be serialized and sent as IntentExtra to the next Activity (e.g. a deeper sub list).

(Originally I asked here a different question. The solution was not related to Serializable and wouldn't help anybody. However MatteKarla gave an interesting input. Thats why I decided to rewrite this question.)

+2  A: 

If you wan't to send complex objects with putExtra() they should implement the Parcelable-interface.

see: http://developer.android.com/intl/fr/reference/android/os/Parcelable.html

MatteKarla
I'm using java.io.Serializable according to the exmaple of http://lyle.smu.edu/~coyle/cse7392mobile/handouts/Intent.DataPassing.ZomDroid.pdf Should I favor Parcelable over Serializeable?
OneWorld
I think you should favor Parcelable if you intend to create a ContentProvider to share your data. And perhaps it's better to send a reference to a really complex object (uri to image instead of sending image using putExtra() )
MatteKarla
I added more information about my app above, so u will see what I am using the intent extras for.
OneWorld