Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Recycled Bitmap Method Stack #31

Open
ScottCooper92 opened this issue Jun 22, 2013 · 0 comments
Open

Recycled Bitmap Method Stack #31

ScottCooper92 opened this issue Jun 22, 2013 · 0 comments

Comments

@ScottCooper92
Copy link

I'm trying to implement an infinite ViewPager that downloads images and displays each in its own instance of a Fragment I have created, using the CacheableImageView to hold the bitmap in the Fragment.

I think this error has something to do with the ViewPager destroying views when they are no longer visible.

06-22 16:44:57.198: W/System.err(25969): java.lang.Throwable: Recycled Bitmap Method Stack
06-22 16:44:57.198: W/System.err(25969): at uk.co.senab.bitmapcache.CacheableBitmapDrawable.checkState(CacheableBitmapDrawable.java:208)
06-22 16:44:57.198: W/System.err(25969): at uk.co.senab.bitmapcache.CacheableBitmapDrawable.access$000(CacheableBitmapDrawable.java:27)
06-22 16:44:57.206: W/System.err(25969): at uk.co.senab.bitmapcache.CacheableBitmapDrawable$CheckStateRunnable.run(CacheableBitmapDrawable.java:239)
06-22 16:44:57.206: W/System.err(25969): at uk.co.senab.bitmapcache.CacheableBitmapDrawable$CheckStateRunnable.run(CacheableBitmapDrawable.java:230)
06-22 16:44:57.206: W/System.err(25969): at uk.co.senab.bitmapcache.WeakReferenceRunnable.run(WeakReferenceRunnable.java:33)
06-22 16:44:57.214: W/System.err(25969): at android.os.Handler.handleCallback(Handler.java:615)
06-22 16:44:57.214: W/System.err(25969): at android.os.Handler.dispatchMessage(Handler.java:92)
06-22 16:44:57.214: W/System.err(25969): at android.os.Looper.loop(Looper.java:137)
06-22 16:44:57.214: W/System.err(25969): at android.app.ActivityThread.main(ActivityThread.java:4895)
06-22 16:44:57.222: W/System.err(25969): at java.lang.reflect.Method.invokeNative(Native Method)
06-22 16:44:57.222: W/System.err(25969): at java.lang.reflect.Method.invoke(Method.java:511)
06-22 16:44:57.222: W/System.err(25969): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
06-22 16:44:57.222: W/System.err(25969): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
06-22 16:44:57.222: W/System.err(25969): at dalvik.system.NativeStart.main(Native Method)
06-22 16:44:57.230: W/System.err(25969): java.lang.IllegalArgumentException: Cannot draw recycled bitmaps
06-22 16:44:57.261: W/System.err(25969): at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:778)
06-22 16:44:57.261: W/System.err(25969): at android.view.GLES20RecordingCanvas.drawBitmap(GLES20RecordingCanvas.java:117)
06-22 16:44:57.269: W/System.err(25969): at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:393)
06-22 16:44:57.269: W/System.err(25969): at uk.co.senab.bitmapcache.CacheableBitmapDrawable.draw(CacheableBitmapDrawable.java:70)
06-22 16:44:57.269: W/System.err(25969): at android.widget.ImageView.onDraw(ImageView.java:979)
06-22 16:44:57.269: W/System.err(25969): at android.view.View.draw(View.java:13765)
06-22 16:44:57.269: W/System.err(25969): at android.view.View.getDisplayList(View.java:12716)
06-22 16:44:57.277: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.277: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.277: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.277: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.277: W/System.err(25969): at android.view.View.getDisplayList(View.java:12714)
06-22 16:44:57.277: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.284: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.284: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.284: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.284: W/System.err(25969): at android.view.View.getDisplayList(View.java:12714)
06-22 16:44:57.284: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.284: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.292: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.292: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.292: W/System.err(25969): at android.view.View.draw(View.java:13768)
06-22 16:44:57.292: W/System.err(25969): at android.support.v4.view.ViewPager.draw(ViewPager.java:2153)
06-22 16:44:57.292: W/System.err(25969): at android.view.View.getDisplayList(View.java:12716)
06-22 16:44:57.300: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.300: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.300: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.300: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.300: W/System.err(25969): at android.view.View.getDisplayList(View.java:12714)
06-22 16:44:57.300: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.308: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.308: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.308: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.308: W/System.err(25969): at android.view.View.draw(View.java:13768)
06-22 16:44:57.308: W/System.err(25969): at android.widget.FrameLayout.draw(FrameLayout.java:467)
06-22 16:44:57.316: W/System.err(25969): at android.view.View.getDisplayList(View.java:12716)
06-22 16:44:57.316: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.323: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.323: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.323: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.323: W/System.err(25969): at android.view.View.getDisplayList(View.java:12714)
06-22 16:44:57.323: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.331: W/System.err(25969): at android.view.View.draw(View.java:13489)
06-22 16:44:57.331: W/System.err(25969): at android.view.ViewGroup.drawChild(ViewGroup.java:2938)
06-22 16:44:57.331: W/System.err(25969): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2808)
06-22 16:44:57.331: W/System.err(25969): at android.view.View.draw(View.java:13768)
06-22 16:44:57.331: W/System.err(25969): at android.widget.FrameLayout.draw(FrameLayout.java:467)
06-22 16:44:57.331: W/System.err(25969): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2394)
06-22 16:44:57.339: W/System.err(25969): at android.view.View.getDisplayList(View.java:12716)
06-22 16:44:57.339: W/System.err(25969): at android.view.View.getDisplayList(View.java:12760)
06-22 16:44:57.339: W/System.err(25969): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1144)
06-22 16:44:57.339: W/System.err(25969): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2265)
06-22 16:44:57.339: W/System.err(25969): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2137)
06-22 16:44:57.339: W/System.err(25969): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1948)
06-22 16:44:57.347: W/System.err(25969): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1105)
06-22 16:44:57.347: W/System.err(25969): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4462)
06-22 16:44:57.347: W/System.err(25969): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
06-22 16:44:57.347: W/System.err(25969): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
06-22 16:44:57.347: W/System.err(25969): at android.view.Choreographer.doFrame(Choreographer.java:525)
06-22 16:44:57.347: W/System.err(25969): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
06-22 16:44:57.347: W/System.err(25969): at android.os.Handler.handleCallback(Handler.java:615)
06-22 16:44:57.355: W/System.err(25969): at android.os.Handler.dispatchMessage(Handler.java:92)
06-22 16:44:57.355: W/System.err(25969): at android.os.Looper.loop(Looper.java:137)
06-22 16:44:57.355: W/System.err(25969): at android.app.ActivityThread.main(ActivityThread.java:4895)
06-22 16:44:57.355: W/System.err(25969): at java.lang.reflect.Method.invokeNative(Native Method)
06-22 16:44:57.355: W/System.err(25969): at java.lang.reflect.Method.invoke(Method.java:511)
06-22 16:44:57.355: W/System.err(25969): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
06-22 16:44:57.355: W/System.err(25969): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
06-22 16:44:57.362: W/System.err(25969): at dalvik.system.NativeStart.main(Native Method)

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

No branches or pull requests

1 participant