You can see from the code below, parcel don't read any key for return the value. How do they know what to read and put into variable someString1
or someString2
and so on?
public SomeObject(Parcel in) {
this.someString1 = in.readString();
this.someString2 = in.readString();
this.someInt = in.readInt();
this.someString3 = in.readString();
this.someInt2 = in.readInt();
}
What if I put it this way. Will the following code become error, because I change the order to read it?
public SomeObject(Parcel in) {
this.someString3 = in.readString();
this.someInt2 = in.readInt();
this.someString1 = in.readString();
this.someString2 = in.readString();
this.someInt = in.readInt();
}