florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

crashes on android 6 #206

Open FahidDis opened 5 years ago

FahidDis commented 5 years ago

When i create object of DateAndTimePicker dialog it crashes on android 6. Works on 7 and above. How to support android 6??

OlehBozhko commented 5 years ago

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.util.Date.getTime()' on a null object reference at java.util.Calendar.setTime(Calendar.java:1197) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.getDate(SingleDateAndTimePicker.java:436) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.updateDaysOfMonth(SingleDateAndTimePicker.java:507) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.setDefaultDate(SingleDateAndTimePicker.java:474) at com.github.florent37.singledateandtimepicker.dialog.SingleDateAndTimePickerDialog.init(SingleDateAndTimePickerDialog.java:166) at com.github.florent37.singledateandtimepicker.dialog.SingleDateAndTimePickerDialog.access$000(SingleDateAndTimePickerDialog.java:23) at com.github.florent37.singledateandtimepicker.dialog.SingleDateAndTimePickerDialog$1.onLoaded(SingleDateAndTimePickerDialog.java:56) at com.github.florent37.singledateandtimepicker.dialog.BottomSheetHelper$1$2.onPreDraw(BottomSheetHelper.java:78) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2467) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1376) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6811) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:896) at android.view.Choreographer.doCallbacks(Choreographer.java:698) at android.view.Choreographer.doFrame(Choreographer.java:633) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:882) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5845) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:768)