1、readFromParcel:

bHasGeofence = in.readByte() == 1;
        bHasGeofenceActive = in.readByte() == 1;

        // ArrayList<VOGeofence> mGeofenceList; //当前设备地围栏
        bHasSchedule = in.readByte() == 1;
        bHasScheduleActive = in.readByte() == 1;

 

也可以使用以下的方法

m_fHasGeofence = (Boolean) in.readValue(Boolean.class.getClassLoader());

2. writeToParcel:

out.writeByte((byte) (bHasGeofence ? 1 : 0));
    out.writeByte((byte) (bHasGeofenceActive ? 1 : 0));
    out.writeByte((byte) (bHasSchedule ? 1 : 0));
    out.writeByte((byte) (bHasScheduleActive ? 1 : 0));

同样也可以使用以下的方法

out.writeValue(m_fHasGeofence);