elizarov
09/28/2017, 7:19 AMMyData
is @Serializable
, then it opens the road to many formats at once. You can JSON.stringify(obj)
or you can ProtoBuf.dump(obj)
and to parcel it you’ll have to have some kind of a helper Parceller
class and use it like Parceller.writeTo(parcel, obj)
. You will not be able just to do parcel.writeValue(obj)
, because a serializable object does not implement android.os.Parcelable
,kingsley
09/28/2017, 4:59 PMpublic static final CREATOR
field. This makes it difficult to simply have a generic solution.
How would this be handled?elizarov
09/28/2017, 7:04 PMparcel.readValue()
. You will not be to read it like that with serializable. You'll do Parceller.read<MyData>(parcel)