Skip to content

Saving Background bitmap with drawn paint causes the app to crash? #16

Description

@imsocb

Hi Chris, Sorry to bother you did not know have you read my previous post to you in another thread here #6. Anyway, have been getting weird errors (double paint on the canvas and crashing the app) occurring when i press the save button that runs this code drawableView.obtainBitmap(bitmap); where i want to save the drawn paint together with the background image. Rather a newbie in android please tell me how I can solve this problem? Thank You

 java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@c6e04c3
                                                                                               at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1270)
                                                                                               at android.graphics.Canvas.drawBitmap(Canvas.java:1404)
                                                                                               at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:544)
                                                                                               at android.view.View.getDrawableRenderNode(View.java:16513)
                                                                                               at android.view.View.drawBackground(View.java:16449)
                                                                                               at android.view.View.draw(View.java:16261)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions