Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ziyang Tan
6,881 PointsBadParcelableException: ClassNotFoundException when unmarshalling
In the writeToParcel(Parcel dest, int flags) method: I just change the order of dest.writeString(mIcon); dest.writeDouble(mTemperatureMax); instead of dest.writeDouble(mTemperatureMax); dest.writeString(mIcon); I t will pop up error of logcat as follows:
BadParcelableException: ClassNotFoundException when unmarshalling: ꏗ?䁎��America/Los_Angeles����com.bojie.stormy.weather.Day����ഀ哸������Clear throughout the day.�� ��clear-day��롒蔞䁐��America/ at android.os.Parcel.readParcelableCreator(Parcel.java:2289) at android.os.Parcel.readParcelable(Parcel.java:2239) at android.os.Parcel.readParcelableArray(Parcel.java:2332) at android.os.Parcel.readValue(Parcel.java:2200) at android.os.Parcel.readArrayMapInternal(Parcel.java:2479) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.Bundle.getParcelableArray(Bundle.java:826) at android.content.Intent.getParcelableArrayExtra(Intent.java:4854) at com.stormy.ui.DailyForecastActivity.onCreate(DailyForecastActivity.java:25) at android.app.Activity.performCreate(Activity.java:5933)
Why this happened? Why the order of writeToParcel need to be fixed??