title: Android handling out of memory exception on image processing
body: <p>This is the sequence part of this question: <a href="https://stackoverflow.com/questions/3674441/combining-2-images-overlayed">Combining 2 Images overlayed</a></p>
  
  <p>so the problem is: if the image size is too big - it'll got an exception (out of memory exception)
  what i want is, to handle even if the handset got the lower spec hardware, it doesn't go to that exception (but it'll take a longer time to process the image)</p>
  
  <p>is it possible to do that?</p>
  
  <p>the code snippet is like this:</p>
  
  <pre><code>public static Bitmap overlay(Bitmap bmp1, Bitmap bmp2) {
      Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig());
      Canvas canvas = new Canvas(bmOverlay);
      canvas.drawBitmap(bmp1, new Matrix(), null);
      canvas.drawBitmap(bmp2, 0, 0, null);
      return bmOverlay;
  }
  </code></pre>
  
  <p>and that block of code is inside the async task.</p>
  
  <p>I really appreciate if someone can help me on this matter.</p>
  
  <p>Thank you and Regards,
  AnD</p>