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

java.lang.ArithmeticException: divide by zero #148

Open ipodipad opened 6 years ago

ipodipad commented 6 years ago

while I flick, exception below occurs

06-23 03:12:02.425 8990-8990/com.github.florent37.sample.singledateandtimepicker E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.github.florent37.sample.singledateandtimepicker, PID: 8990
    java.lang.ArithmeticException: divide by zero
        at com.github.florent37.singledateandtimepicker.widget.WheelPicker$Adapter.getItem(WheelPicker.java:1071)
        at com.github.florent37.singledateandtimepicker.widget.WheelPicker.onItemSelected(WheelPicker.java:626)
        at com.github.florent37.singledateandtimepicker.widget.WheelPicker.access$600(WheelPicker.java:35)
        at com.github.florent37.singledateandtimepicker.widget.WheelPicker$3.onAnimationEnd(WheelPicker.java:617)
        at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1163)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1323)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.-wrap2(AnimationHandler.java)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:869)
        at android.view.Choreographer.doCallbacks(Choreographer.java:683)
        at android.view.Choreographer.doFrame(Choreographer.java:616)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6313)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
harikesh59 commented 6 years ago

Getting the same issue while selecting date.

nuggy875 commented 6 years ago

Same here...

Vinnie1991 commented 6 years ago

I've had the same issue. When I disabled the function .secondDateAfterFirst(true) I didn't get the crash.

adeelna commented 6 years ago

getting same crash

anuress commented 6 years ago

I've made pull request for the fix in #156