I want to pass on object between two activities in Android which has lead me to parcelable classes. I am not trying to convert my current class but don\'t understand the Par
On GitHub you can find some code I wrote some time ago for simplifying the handling of Parcelables (e.g. writing to and reading from parcels, simplifying the initializer code for CREATORs).
Writing to a parcel:
parcelValues(dest, name, maxSpeed, weight, wheels, color, isDriving);
where color is an enum and isDriving is a boolean, for example.
Reading from a parcel:
// [...]
color = (CarColor)unparcelValue(CarColor.class.getClassLoader());
isDriving = (Boolean)unparcelValue();
Creating a CREATOR for classes:
public static final Parcelable.Creator CREATOR =
Parceldroid.getCreatorForClass(Car.class);
...or for enums:
public static final Parcelable.Creator CREATOR =
Parceldroid.getCreatorForEnum(CarColor.class);
Just take a look at the "ParceldroidExample" I added to the project.