Android 包裹类读取错误

Android 包裹类读取错误,android,parcelable,parcel,Android,Parcelable,Parcel,当我尝试RestaurantModel restaurant=getIntent().getParcelableExtra(“restaurant”) 它在.readList(unitModels,UnitModel.class.getClassLoader())中调用(第二个包裹类) 然后它在.readList(deliveryModels,DeliveryModel.class.getClassLoader())中的中崩溃(第三类包裹) protectedrestaurantmodel(包裹

当我尝试
RestaurantModel restaurant=getIntent().getParcelableExtra(“restaurant”)

它在.readList(unitModels,UnitModel.class.getClassLoader())中调用(第二个包裹类)

然后它在.readList(deliveryModels,DeliveryModel.class.getClassLoader())中的
中崩溃(第三类包裹)

protectedrestaurantmodel(包裹中){
description=in.readString();
id=in.readInt();
logo=in.readString();
photo=(位图)位于.readValue(Bitmap.class.getClassLoader())中;
name=in.readString();
if(in.readByte()==0x01){
unitModels=新的ArrayList();
in.readList(unitModels,UnitModel.class.getClassLoader());
}否则{
unitModels=null;
}
website=in.readString();
}
受保护的单元模型(地块中){
地址=in.readString();
canDeliver=in.readByte()!=0x00;
city=in.readString();
if(in.readByte()==0x01){
deliveryModels=new ArrayList();
in.readList(deliveryModels,DeliveryModel.class.getClassLoader());
}否则{
deliveryModels=null;
}
id=in.readInt();
networkID=in.readInt();
phone=in.readString();
if(in.readByte()==0x01){
timeModels=newarraylist();
in.readList(timeModels,TimeModel.class.getClassLoader());
}否则{
timeModels=null;
}
}
错误日志:

 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.Restaurant.Restaurant}: java.lang.RuntimeException: Parcel android.os.Parcel@41c54770: Unmarshalling unknown type code 3801136 at offset 612
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
            at android.app.ActivityThread.access$800(ActivityThread.java:156)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:157)
            at android.app.ActivityThread.main(ActivityThread.java:5872)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@41c54770: Unmarshalling unknown type code 3801136 at offset 612
            at android.os.Parcel.readValue(Parcel.java:2089)
            at android.os.Parcel.readListInternal(Parcel.java:2352)
            at android.os.Parcel.readList(Parcel.java:1587)
            at com.app.Restaurant.UnitModel.<init>(UnitModel.java:56)
            at com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:13)
            at com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:10)
            at android.os.Parcel.readParcelable(Parcel.java:2113)
            at android.os.Parcel.readValue(Parcel.java:2022)
            at android.os.Parcel.readListInternal(Parcel.java:2352)
            at android.os.Parcel.readList(Parcel.java:1587)
            at com.app.Restaurant.RestaurantModel.<init>(RestaurantModel.java:47)
            at com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:14)
            at com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:11)
            at android.os.Parcel.readParcelable(Parcel.java:2113)
            at android.os.Parcel.readValue(Parcel.java:2022)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2323)
            at android.os.Bundle.unparcel(Bundle.java:249)
            at android.os.Bundle.getParcelable(Bundle.java:1206)
            at android.content.Intent.getParcelableExtra(Intent.java:5007)
            at com.app.Restaurant.Restaurant.onCreate(Restaurant.java:30)
java.lang.RuntimeException:无法启动活动组件信息{com.app/com.app.Restaurant.Restaurant}:java.lang.RuntimeException:包android.os。Parcel@41c54770:在偏移量612处解组未知类型代码3801136
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)上
位于android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
在android.app.ActivityThread.access$800(ActivityThread.java:156)
在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
位于android.os.Handler.dispatchMessage(Handler.java:102)
位于android.os.Looper.loop(Looper.java:157)
位于android.app.ActivityThread.main(ActivityThread.java:5872)
位于java.lang.reflect.Method.Invokenactive(本机方法)
位于java.lang.reflect.Method.invoke(Method.java:515)
在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)上
位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
在dalvik.system.NativeStart.main(本机方法)
原因:java.lang.RuntimeException:Parcel android.os。Parcel@41c54770:在偏移量612处解组未知类型代码3801136
位于android.os.Parcel.readValue(Parcel.java:2089)
位于android.os.Parcel.readListInternal(Parcel.java:2352)
位于android.os.Parcel.readList(Parcel.java:1587)
在com.app.Restaurant.UnitModel上(UnitModel.java:56)
在com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:13)上
在com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:10)上
位于android.os.Parcel.readParcelable(Parcel.java:2113)
位于android.os.Parcel.readValue(Parcel.java:2022)
位于android.os.Parcel.readListInternal(Parcel.java:2352)
位于android.os.Parcel.readList(Parcel.java:1587)
在com.app.Restaurant.RestaurantModel.(RestaurantModel.java:47)
在com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:14)上
在com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:11)上
位于android.os.Parcel.readParcelable(Parcel.java:2113)
位于android.os.Parcel.readValue(Parcel.java:2022)
位于android.os.Parcel.ReadyArrayMapInternal(Parcel.java:2323)
位于android.os.Bundle.unparcel(Bundle.java:249)
位于android.os.Bundle.getParcelable(Bundle.java:1206)
位于android.content.Intent.getParcelableExtra(Intent.java:5007)
位于com.app.Restaurant.Restaurant.onCreate(Restaurant.java:30)

首先,您解决问题了吗?2-什么是“in.readByte()==0x01”?
 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.Restaurant.Restaurant}: java.lang.RuntimeException: Parcel android.os.Parcel@41c54770: Unmarshalling unknown type code 3801136 at offset 612
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
            at android.app.ActivityThread.access$800(ActivityThread.java:156)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:157)
            at android.app.ActivityThread.main(ActivityThread.java:5872)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@41c54770: Unmarshalling unknown type code 3801136 at offset 612
            at android.os.Parcel.readValue(Parcel.java:2089)
            at android.os.Parcel.readListInternal(Parcel.java:2352)
            at android.os.Parcel.readList(Parcel.java:1587)
            at com.app.Restaurant.UnitModel.<init>(UnitModel.java:56)
            at com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:13)
            at com.app.Restaurant.UnitModel$1.createFromParcel(UnitModel.java:10)
            at android.os.Parcel.readParcelable(Parcel.java:2113)
            at android.os.Parcel.readValue(Parcel.java:2022)
            at android.os.Parcel.readListInternal(Parcel.java:2352)
            at android.os.Parcel.readList(Parcel.java:1587)
            at com.app.Restaurant.RestaurantModel.<init>(RestaurantModel.java:47)
            at com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:14)
            at com.app.Restaurant.RestaurantModel$1.createFromParcel(RestaurantModel.java:11)
            at android.os.Parcel.readParcelable(Parcel.java:2113)
            at android.os.Parcel.readValue(Parcel.java:2022)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2323)
            at android.os.Bundle.unparcel(Bundle.java:249)
            at android.os.Bundle.getParcelable(Bundle.java:1206)
            at android.content.Intent.getParcelableExtra(Intent.java:5007)
            at com.app.Restaurant.Restaurant.onCreate(Restaurant.java:30)