Skip to content Skip to sidebar Skip to footer

Android Annotations, Parcelable Object As Extra, Producing IllegalArgumentException: Is Not A Constant In Android.text.Layout$Alignment

I've got a class that is Parcelable and its data members are made up of Strings, Integers, Booleans, Dates, and other Parcelable objects which are made up of the same kinds of thin

Solution 1:

Thank you to @WonderCsabo for questioning my assumptions about my parcelling code and the objects being parceled. I made some code changes which fixed the problem and here's my assumption about what was really going wrong.

The error I made was in my Parcel in/out code. I was writing 20 fields to the Parcel, but when reading from the Parcel I was only reading 15 fields. Making sure my in-code matched my out-code made the problem go away.

I think what was happening is that since there was still data to unpack that it was screwing up another item that needed to get unpacked and throwing an exception that seemed unrelated.


Post a Comment for "Android Annotations, Parcelable Object As Extra, Producing IllegalArgumentException: Is Not A Constant In Android.text.Layout$Alignment"