Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

facing crash issue while working with Viewpager + timer + dots indicator #143

Closed
BhagyashreeWani opened this issue Apr 10, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@BhagyashreeWani
Copy link

I am facing below issue randomly with this indicator :

Implementation :
Fragment 1 contains viewpager and dots indicator
Used timer to move next on viewpager page so the dots indicator as well
on click of button -> App navigates to Fragment 2
When click backpress from fragment 2, app crashes with below exception -

App crash exception:
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-3
at java.util.ArrayList.get(ArrayList.java:439)
at com.tbuonomo.viewpagerdotsindicator.WormDotsIndicator$buildOnPageChangedListener$1.onPageScrolled$viewpagerdotsindicator_release(WormDotsIndicator.kt:164)
at com.tbuonomo.viewpagerdotsindicator.OnPageChangeListenerHelper.onPageScrolled(OnPageChangeListenerHelper.kt:22)
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator$setViewPager$2$addOnPageChangeListener$1.onPageScrolled(BaseDotsIndicator.kt:218)
at androidx.viewpager.widget.ViewPager.dispatchOnPageScrolled(ViewPager.java:1930)
at androidx.viewpager.widget.ViewPager.onPageScrolled(ViewPager.java:1904)
at androidx.viewpager.widget.ViewPager.pageScrolled(ViewPager.java:1842)
at androidx.viewpager.widget.ViewPager.completeScroll(ViewPager.java:1988)
at androidx.viewpager.widget.ViewPager.scrollToItem(ViewPager.java:692)
at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1786)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1873)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1083)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:754)
at android.view.View.layout(View.java:20865)
at android.view.ViewGroup.layout(ViewGroup.java:6215)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3179)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2678)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1810)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8084)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1312)
at android.view.Choreographer.doCallbacks(Choreographer.java:1123)
at android.view.Choreographer.doFrame(Choreographer.java:941)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1298)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)

@tommybuonomo tommybuonomo self-assigned this Apr 30, 2022
@tommybuonomo tommybuonomo added this to the 4.3 milestone Apr 30, 2022
@tommybuonomo
Copy link
Owner

Hello, thanks for your contribution !
This issue is now fixed in the new version 4.3
Thanks 🔥

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

No branches or pull requests

2 participants