title: catch "RuntimeException: Canvas: trying to draw too large..."
body: <p>I have an application which draws an image from the file system to screen like so: </p>
  
  <pre><code>Bitmap image = BitmapFactory.decodeFile(file.getPath());
  imageView.setImageBitmap(image);
  </code></pre>
  
  <p>If the image is very large I see this error: </p>
  
  <pre><code>java.lang.RuntimeException: Canvas: trying to draw too large(213828900bytes) bitmap.
      at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)
      at android.graphics.Canvas.drawBitmap(Canvas.java:1415)
      ...
  </code></pre>
  
  <p>The stack does not reach my code. How can I catch this error? Or is there a more appropriate way to be drawing the image to the <code>imageView</code> that can avoid this error? </p>