I\'m trying to write an array of objects that implement Parcelable into a Parcel using writeParcelableArray.
The objects I\'m trying to write are defined (as you\'
Actually, you can extend an interface, and it looks like you need to do just that. The generics parameter in writeParcelableArray is asking for an extended interface (not the interface itself). Try creating an interface MyParcelable extends Parcelable. Then declaring your array using the interface, but the impl should be your Arrival extends MyParcelable.
It turns out it just wanted me to build an array of Parcelables. To use the example from the question:
@Override
public void writeToParcel(Parcel dest, int flags) {
Parcelable[] a;
/*
some stuff to populate "a" with Arrival
objects (which implements Parcelable)
*/
dest.writeParcelableArray(a, 0);
}
I know the problem is solved but my solution was other so I'm posting it here: in my case Eclipse automatically imported wrong package because of classes names abiguity(some dom.Comment instead of my Comment class).