I want to send an object between Activities. Reading up on this i have come to conclusion that using Parcelable is the best way to go as it has the least performance impacts. The reason i want to do this is because i need to download data from the network to create an Object, so i don't want to keep downloading the data.
However, in order to use a Parcel the class needs to implement Parcelable. As i am trying to send an Object defined in a Library i cannot edit the class to include this.
What would be the best way to solve my predicament?
I have tried extending the library class and implementing Parcelable but failed with a ClassCastException. I have also seen mentioned that i should make a Parcelable class that wraps around my library class and send it that way?
Thanks!
How about using the parceler library? You can tell your
Application
to parcel library classes:If that works, you could use the following code to wrap/unwrap: