parcel

How to use Parcel in Android?

I'm trying to use Parcel to write and then read back a Parcelable. For some reason, when I read the object back from the file, it's coming back as null. public void testFoo() { final Foo orig = new Foo("blah blah"); // Wrote orig to a parcel and then byte array final Parcel p1 = Parcel.obtain(); p1.writeValue(orig); ...

Writing arrays of Parcelables to a Parcel in Android

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'd expect) as: public class Arrival implements Parcelable { /* All the right stuff in here... this class compiles and acts fine. */ } And I'm trying to write them into a ...

android parcelable string array

I have ArrayList<String> ids = ArrayList<String>(); What would be the cleanest way to make it Parceleable? Apparently String itself is not parcelable, so Parcel.writeList(ids) is not working. I was thinking to either parcelize ArrayList<Uri> or put array contents into a Bundle. ...