Skip to content

null pointer exceptions when the view is not visiable on screen  #4

@michaelsam94

Description

@michaelsam94

there is null point exception thrown when fragment which contain the viewpager and indicator not visible on screen. Here is stacktrace.
java.lang.NullPointerException: Attempt to invoke virtual method 'int io.github.vejei.viewpagerindicator.animation.AnimationValue$SlideAnimationValue.getCoordinateX()' on a null object reference at io.github.vejei.viewpagerindicator.painter.RectPainter$SlideAnimationPainter.draw(RectPainter.java:101) at io.github.vejei.viewpagerindicator.indicator.RectIndicator.onDraw(RectIndicator.java:175) at android.view.View.draw(View.java:16270) at android.view.View.updateDisplayListIfDirty(View.java:15267) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1478) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15262) at android.view.View.draw(View.java:16040) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions