I am implementing Parcelable in order to transmit some simple data throughout an Intent.
However, There is one method in the Parcelable interface that I don\'t understand at
It is there to prepare the typed array without all the generics stuff. That's it.
Returning just the standard return new MyParcelable[size];
is fine.
It is normal, that you never call it yourself. However, by calling something like Bundle.getParcelableArray()
you end up in this method indirectly.
newArray is responsible to create an array of our type of the appropriate size
this is a function to be called when you try to deserialize an array of Parcelable
objects and for each single object createFromParcel
is called.