Android unmarshalling from Parcel

When unmarshalling from a byte array into a Parcel object, be sure to reset (setDataPosition(0)) it before reading out any object.

Example:

Parcel p = Parcel.obtain();
p.unmarshall(buff, 0, length);
p.setDataPosition(0);
return p.readBundle();

Leave a Reply