Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

java.lang.ArithmeticException: divide by zero #148

Open
ipodipad opened this issue Jun 23, 2018 · 5 comments
Open

java.lang.ArithmeticException: divide by zero #148

ipodipad opened this issue Jun 23, 2018 · 5 comments

Comments

@ipodipad
Copy link

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
Copy link

Getting the same issue while selecting date.

@nuggy875
Copy link

nuggy875 commented Jul 9, 2018

Same here...

@Vinnie1991
Copy link

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

Akhunzaada added a commit to Akhunzaada/SingleDateAndTimePicker that referenced this issue Jul 11, 2018
The crash was caused because of the options secondDateAfterFirst which was added in the commit db112c9
The issue was only reproduced when the flag secondDateAfterFirst was set to true and the WheelDayOfMonthPicker view was visible.
The listener addOnDateChangedListener was updating the second picker with the minimum date whereas when the WheelDayOfMonthPicker's visibility was gone, the picker had no items resulting in a crash in getItem() method of the WheelPicker adapter.
@adeelna
Copy link

adeelna commented Jul 18, 2018

getting same crash

@anuress
Copy link
Contributor

anuress commented Aug 2, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants