My int variables are not reading/writing correctly in my Parcelable object. I am passing my object from one activity to another but the int variables are not the same once I pass it and read it.
Heres my code.
PARCELABLE OBJECT:
class someObject implements Parcelable
int something;
int something2;
//normal constructor
...
public someObject(Parcel in){
this.something = in.readInt();
this.something2 = in.readInt();
}
public void writeToParcel(Parcel dest, int flags){
dest.writeInt(something);
dest.writeInt(something2);
}
//creator and other parcel stuff
...
//mutators for int variables
...
How I passed it in activity1:
//instantiate someObject
...
Intent intent = new Intent(activity1.this, activity2.class);
intent.putExtras("stuff", someObject);
Passed to activity2:
onCreate(Bundle blah){
Bundle b = getIntent.getExtras();
someObject some = b.getParcelable("stuff");
}
I output something and something2 within the constructor and the activity that I pass it too. They are different values, what did I do wrong?
I have other String member variables in my parcelable object class and they seem to work. Just the 2 ints are not working properly.