I\'ve got a few classes that implement Parcelable and some of these classes contain each other as properties. I\'m marshalling the classes into a Parcel to pass them between
Well I had the same problem and solve it in a very silly way that I dont know if its called a solution at all.
lets say you have this class you want to pass to another activity
public class Person implements Parcelable,Serializable{
public String Name;
public int Age;
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name);
dest.writeInt(age);
}
public SeriesInfo(Parcel in) {
age= in.readInt(); //her was my problem as I have put age befor name
//while in the writeToParcel function I have defined
//dest.writeInt(age) after in.readString();???!!!!
name= in.readString();
}
}
Thats it When I changed the:
dest.writeString(name);
dest.writeInt(age);
to
dest.writeInt(age);
dest.writeString(name);
The problem was solved???!!!!