You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I am trying to do: set switch state to PRESS right after application starts.
Every time I get Null Pointer Exception, because switch is in INIT state.
How to reproduce bug:
protectedvoidonCreate(BundlesavedInstanceState) {
if (shouldBeOn && !materialAnimatedSwitch.isChecked()) {
materialAnimatedSwitch.toggle();
}
}
Cause:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.animation.ValueAnimator.start()' on a null object reference
at
com.github.glomadrian.materialanimatedswitch.painter.BallPainter.setState(BallPainter.java:108)
at com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch.setState(MaterialAnimatedSwitch.java:139)
at com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch.doActionDown(MaterialAnimatedSwitch.java:164)
at com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch.toggle(MaterialAnimatedSwitch.java:178)`
The text was updated successfully, but these errors were encountered:
What I am trying to do: set switch state to PRESS right after application starts.
Every time I get Null Pointer Exception, because switch is in INIT state.
How to reproduce bug:
Cause:
The text was updated successfully, but these errors were encountered: