title: Bitmap.recycle() Calling it after drawing
body: <p>I am having a problem. I have a post draw listener where I draw a scaled version of a bitmap. The problem stems from the fact that I tend to do some scaling every time a zoom happens (zoom in scale up, zoom out scale down). The problem is I am not able to recycle the bitmap because when I try to do so after drawing </p>
  
  <pre><code>canvas.draw(scaledbitmap,0,0,null);
  scaledBitmap.recycle()
  </code></pre>
  
  <p>i get the Canvas canot draw recycled bitmap exception</p>
  
  <p>Does anyone know how I would go about recycling a bitmap after I am done with it so that another can be scaled afterwards and I don't get the OutOfMemoryException crash.</p>
  
  <p>Some Code to show you exactly how I am using it:</p>
  
  <pre><code>private SpenDrawListener mPosteDrawListener = new SpenDrawListener() {
  
          @Override
          public void onDraw(Canvas canvas, float x, float y, float ratio,
              float frameStartX, float frameStartY, RectF updateRect) {
              if(mLineDrawingBitmap == null)
                  mLineDrawingBitmap = loadLineDrawingBitmap(mLineDrawingFileName);
  
              Bitmap bm = Bitmap.createScaledBitmap(mLineDrawingBitmap, (int)(mLineDrawingBitmap.getWidth() * ratio), (int)(mLineDrawingBitmap.getHeight() * ratio), true);
              /*
              float pointX = (mScreenRect.width() - bm.getWidth()) / 2;
              float pointY = mScreenRect.height() / 2 - bm.getHeight();
              */
              float pointX = frameStartX - (x * ratio);
              float pointY = frameStartY - (y * ratio);
  
              //canvas.drawBitmap(bm, 0, 0,null);
              canvas.drawBitmap(bm, pointX, pointY, null);
  
              //bm.recycle();
          }
      };
  </code></pre>