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

Application Not Responding (ANR) about 1 minute when use with attach/detach fragment #64

Open
VuHongKy opened this issue May 20, 2020 · 0 comments

Comments

@VuHongKy
Copy link

VuHongKy commented May 20, 2020

1 - Description:
I'm using GlideSlider in HomeFragment, HomeFragment is one of four bottom tabs (using library https://github.com/ncapdevi/FragNav).
When the app run about 15-30 minutes, GlideSlider auto cycled on that time.
After that, I move from HomeFragment (detach) -> to ChildFragment (attach) -> and back to HomeFragment (HomeFragment attach again) -> app got Application Not Responding (ANR) with log:

at com.glide.slider.library.tricks.ViewPagerEx.populate(ViewPagerEx.java:1046)
  at com.glide.slider.library.tricks.ViewPagerEx.populate(ViewPagerEx.java:931)
  at com.glide.slider.library.tricks.ViewPagerEx.onMeasure(ViewPagerEx.java:1454)
  at android.view.View.measure(View.java:23398)
  at android.widget.RelativeLayout.measureChild(RelativeLayout.java:676)
  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:479)

2 - Find out the reason
I tried to find ViewPagerEx.java line 1046 and found this:
for (int pos = mCurItem + 1; pos < N; pos++) {} where N = Integer.MAX_VALUE

I think that is the problem. Do we really need to loop from currentItemPos to Integer.MAX_VALUE (~ 2,147,483,647)? If we need, do we have another way to do loop slider without this way: InfinitePagerAdapter.getCount() = Integer.MAX_VALUE??

Please help me with this case @firdausmaulan

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

No branches or pull requests

1 participant