title: overlay two images in android to set an imageview
body: <p>I am trying to overlay two images in my app, but they seem to crash at my <code>canvas.setBitmap()</code> line. What am I doing wrong?</p>
  
  <pre><code>private void test() {
      Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.t);
      Bitmap mBitmap2 = BitmapFactory.decodeResource(getResources(), R.drawable.tt);
      Bitmap bmOverlay = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), mBitmap.getConfig());
      Canvas canvas = new Canvas();
      canvas.setBitmap(bmOverlay);
      canvas.drawBitmap(mBitmap, new Matrix(), null);
      canvas.drawBitmap(mBitmap2, new Matrix(), null);
      testimage.setImageBitmap(bmOverlay);
  }
  </code></pre>