In my Parcelable class, inside the writeToParcel
method, I get this error:
Inferred type 'MyObject' for type parameter 'T' is not within its bound; should
implement 'android.os.Parcelable
when I try to write an ArrayList, by this way:
dest.writeTypedList(new ArrayList<MyObject>());
In my code I can write strings by dest.writeString
, but when I try to write this Array
of MyObject
I get the above mentioned error.
How can I fix this?
What is the best way to write an ArrayList to a Parcel object?
Thank you!