diff --git a/app/src/main/java/tk/therealsuji/vtopchennai/models/Assignment.java b/app/src/main/java/tk/therealsuji/vtopchennai/models/Assignment.java index da2370a..09fd332 100644 --- a/app/src/main/java/tk/therealsuji/vtopchennai/models/Assignment.java +++ b/app/src/main/java/tk/therealsuji/vtopchennai/models/Assignment.java @@ -52,6 +52,9 @@ protected Assignment(Parcel in) { dueDate = in.readLong(); cutoffDate = in.readLong(); + if (dueDate == 0) dueDate = null; + if (cutoffDate == 0) cutoffDate = null; + introAttachments = new ArrayList<>(); in.readList(introAttachments, Attachment.class.getClassLoader()); } @@ -67,8 +70,13 @@ public void writeToParcel(Parcel parcel, int i) { parcel.writeString(course); parcel.writeString(title); parcel.writeString(intro); + if (dueDate != null) parcel.writeLong(dueDate); + else parcel.writeLong(0); + if (cutoffDate != null) parcel.writeLong(cutoffDate); + else parcel.writeLong(0); + parcel.writeList(introAttachments); } }