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

Trying to recycle Bitmap #27

Open
ManojMM026 opened this issue Nov 25, 2013 · 2 comments
Open

Trying to recycle Bitmap #27

ManojMM026 opened this issue Nov 25, 2013 · 2 comments

Comments

@ManojMM026
Copy link

Hi i am getting strange exception when i take picture from camera and try to crop it.
Here is my log cat.

I am facing this issue on Galaxy Grand with os 4.2.2

11-25 17:44:28.909: E/AndroidRuntime(30645): FATAL EXCEPTION: Thread-6510
11-25 17:44:28.909: E/AndroidRuntime(30645): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@42765a00
11-25 17:44:28.909: E/AndroidRuntime(30645): at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026)
11-25 17:44:28.909: E/AndroidRuntime(30645): at android.graphics.Canvas.drawBitmap(Canvas.java:1096)
11-25 17:44:28.909: E/AndroidRuntime(30645): at android.graphics.Bitmap.createBitmap(Bitmap.java:646)
11-25 17:44:28.909: E/AndroidRuntime(30645): at eu.janmuller.android.simplecropimage.CropImage$1.prepareBitmap(CropImage.java:558)
11-25 17:44:28.909: E/AndroidRuntime(30645): at eu.janmuller.android.simplecropimage.CropImage$1.run(CropImage.java:564)
11-25 17:44:28.909: E/AndroidRuntime(30645): at eu.janmuller.android.simplecropimage.CropImage$6.run(CropImage.java:271)
11-25 17:44:28.909: E/AndroidRuntime(30645): at eu.janmuller.android.simplecropimage.Util$BackgroundJob.run(Util.java:175)
11-25 17:44:28.909: E/AndroidRuntime(30645): at java.lang.Thread.run(Thread.java:856)

@hjkatz
Copy link

hjkatz commented Dec 2, 2013

I ran into this exact problem simply add this to the prepareBitmap() method, after checking for null add this:

if( mBitmap.isRecycled() )
{
mBitmap = getBitmap( mImagePath );
}

Good luck!

@yundddd
Copy link

yundddd commented Apr 3, 2015

Thanks, I have exactly the same problem.

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

3 participants