Possible Duplicate:
How to send an object from one Android Activity to another using Intents?
I want to pass a class object from an Activity to other when one Activity calls to the other. I am trying to use Intent.putExtra(name, value) to make that but then I don´t have Intent.getExtra(name) method. There are a lot of methods like getStringExtra(name), getDataExtra(name) and so on but what I put in the value of putExtra is a class object that have a lot of different values as String, Data and int. How can I make to pass that class?
You can use
SerializableorParcelableIf you use
Serializableyou only have to implement it by writingimplements SerializableIf you use
Parcelableyou have to fill in the used methodes. See: http://developer.android.com/reference/android/os/Parcelable.htmlRead about the differences here: http://www.mooproductions.org/node/6
Conclusion:
Parcelableis really alot faster but takes more time to implement.