ongakuer / CircleIndicator

A lightweight indicator like in nexus 5 launcher
Apache License 2.0
4.27k stars 712 forks source link

Animator NullPointerException #41

Closed LiuDeng closed 8 years ago

LiuDeng commented 8 years ago

12-17 09:50:04.638 12608-12608/? A/MobUncaughtExceptionHandler: null java.lang.NullPointerException at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:744) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1012) at android.animation.ValueAnimator.access$400(ValueAnimator.java:51) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:623) at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:639) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:531) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) 12-17 09:50:04.646 12608-12608/? E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NullPointerException at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:744) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1012) at android.animation.ValueAnimator.access$400(ValueAnimator.java:51) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:623) at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:639) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:531) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)

gunhansancar commented 8 years ago

I also get this error on some android 4.4 devices. It happens after I call this line second time

    circleIndicator.setViewPager(viewPager);

Without calling I cannot update the position of circle indicator, I tried circleIndicator.invalidate() etc. no help.

LiuDeng commented 8 years ago

temporary i comment //if (animator.isRunning()) animator.end(); //animator.setTarget(Indicator); //animator.start(); fix this hope will fix soon

gunhansancar commented 8 years ago

Did you notice any side effects after commented out these lines?

LiuDeng commented 8 years ago

just comment the lines in addIndicator and it work ok now