Repository: wdullaer/MaterialDateTimePicker

Issue #349: IOException after updating from 3.0.0 to 3.2.0
Created: 2017-05-08T05:32:25Z
Hello, I encounter this exception after updating from 3.0.0 to 3.2.0. Some of my app user experienced it and I haven't able to reproduce it myself. (log taken from fabric)
Fatal Exception: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.wdullaer.materialdatetimepicker.date.DefaultDateRangeLimiter)
       at android.os.Parcel.writeSerializable(Parcel.java:1394)
       at android.os.Parcel.writeValue(Parcel.java:1341)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
       at android.os.Bundle.writeToParcel(Bundle.java:1034)
       at android.os.Parcel.writeBundle(Parcel.java:669)
       at android.app.FragmentState.writeToParcel(Fragment.java:144)
       at android.os.Parcel.writeTypedArray(Parcel.java:1197)
       at android.app.FragmentManagerState.writeToParcel(FragmentManager.java:381)
       at android.os.Parcel.writeParcelable(Parcel.java:1363)
       at android.os.Parcel.writeValue(Parcel.java:1268)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
       at android.os.Bundle.writeToParcel(Bundle.java:1034)
       at android.os.Parcel.writeBundle(Parcel.java:669)
       at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3232)
       at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3653)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5763)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by java.io.NotSerializableException: com.wdullaer.materialdatetimepicker.date.DatePickerDialog
       at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1344)
       at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
       at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)
       at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)
       at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)
       at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
       at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
       at android.os.Parcel.writeSerializable(Parcel.java:1389)
       at android.os.Parcel.writeValue(Parcel.java:1341)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
       at android.os.Bundle.writeToParcel(Bundle.java:1034)
       at android.os.Parcel.writeBundle(Parcel.java:669)
       at android.app.FragmentState.writeToParcel(Fragment.java:144)
       at android.os.Parcel.writeTypedArray(Parcel.java:1197)
       at android.app.FragmentManagerState.writeToParcel(FragmentManager.java:381)
       at android.os.Parcel.writeParcelable(Parcel.java:1363)
       at android.os.Parcel.writeValue(Parcel.java:1268)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
       at android.os.Bundle.writeToParcel(Bundle.java:1034)
       at android.os.Parcel.writeBundle(Parcel.java:669)
       at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3232)
       at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3653)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5763)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Here's my code:
final int year = CALENDAR.get(Calendar.YEAR);
                final int month = CALENDAR.get(Calendar.MONTH);
                final int date = CALENDAR.get(Calendar.DATE);

                final DatePickerDialog dialog = DatePickerDialog.newInstance(new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePickerDialog view, int i, int i1, int i2) {
                        CALENDAR.set(i, i1, i2);
                        tanggal.setText(Helper.getReadableDate(CALENDAR));
                    }
                }, year, month, date);

                dialog.setMinDate(Helper.getTomorrowDate());
                dialog.show(getBaseActivity().getFragmentManager(), "datepicker");

Duplicate issue #368: Fatal Exception: java.lang.RuntimeException
Created: 2017-06-10T16:48:43Z
Sometimes i have this exception on DefaultDateRangeLimiter
Some object isn't serializable and causes this exception
Fatal Exception: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.virail.views.materialdatetimepicker.date.DefaultDateRangeLimiter)
at android.os.Parcel.writeSerializable(Parcel.java:1447)
at android.os.Parcel.writeValue(Parcel.java:1395)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1337)
at android.os.Bundle.writeToParcel(Bundle.java:1079)
at android.os.Parcel.writeBundle(Parcel.java:690)
at android.app.FragmentState.writeToParcel(Fragment.java:142)
at android.os.Parcel.writeTypedArray(Parcel.java:1233)
at android.app.FragmentManagerState.writeToParcel(FragmentManager.java:381)
at android.os.Parcel.writeParcelable(Parcel.java:1416)
at android.os.Parcel.writeValue(Parcel.java:1322)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1337)
at android.os.Bundle.writeToParcel(Bundle.java:1079)
at android.os.Parcel.writeBundle(Parcel.java:690)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3153)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3455)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5621)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

Closing comment (2017-06-10T18:26:15Z): Duplicate of #349
This has been resolved in the latest version of this library