Devlight / InfiniteCycleViewPager

Infinite cycle ViewPager with two-way orientation and interactive effect.
Apache License 2.0
5.75k stars 831 forks source link

when I use startAutoScroll I got this error #19

Open roadmore opened 8 years ago

roadmore commented 8 years ago

09-21 14:49:33.244 11939-11939/com.gigamole.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gigamole.sample, PID: 11939 java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:613) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:440) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840) at android.content.res.Resources.loadDrawable(Resources.java:2174) at com.huawei.android.content.res.ResourcesEx.loadDrawable(ResourcesEx.java:636) at android.content.res.Resources.getDrawable(Resources.java:747) at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:323) at android.support.v7.internal.widget.TintManager.getDrawable(TintManager.java:177) at android.support.v7.internal.widget.TintManager.getDrawable(TintManager.java:170) at android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:53) at android.support.v7.widget.AppCompatImageView.setImageResource(AppCompatImageView.java:74) at com.gigamole.sample.utils.Utils.setupItem(Utils.java:20) at com.gigamole.sample.adapters.HorizontalPagerAdapter.instantiateItem(HorizontalPagerAdapter.java:74) at com.gigamole.infinitecycleviewpager.InfiniteCyclePagerAdapter.instantiateItem(InfiniteCyclePagerAdapter.java:68) at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:870) at android.support.v4.view.ViewPager.populate(ViewPager.java:1086) at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:552) at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:514) at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:506) at com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager.setCurrentItem(HorizontalInfiniteCycleViewPager.java:222) at com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager.setCurrentItem(HorizontalInfiniteCycleViewPager.java:216) at com.gigamole.infinitecycleviewpager.InfiniteCycleManager$1.run(InfiniteCycleManager.java:126) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5333) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:711) at dalvik.system.NativeStart.main(Native Method)

GIGAMOLE commented 8 years ago

Hello. Thanks for interesting issue. This is strange, because ICVP doesnt work with bitmaps. Maybe in your pages there some work with bitmap?

roadmore commented 8 years ago

Thank you for your rapid reply. I run the example you gave, and then I replaced a few image . When I start startAutoScroll(200) and press home button ,the AutoScroll thread keep on running,finally I got this error. Maybe I should stop auto scroll in onPause() method!

GIGAMOLE commented 8 years ago

Yeah. You should control it.