hi mate i have a class that must to implement Parcelable to allow to put this new type in a bundle
My class have 2 attribute
private int pid;
private Object data;
i have to implement writeToParcel method : but i dont know to write the attribute data
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(pid);
dest.?
}
Take a look at the documentation of Parcelable. It shows an example for adding and retreiving primitive values.
If you want to add Objects to a Parcelable the Object you want to add must implement either Parcelable or Serializable.