title: Background image slows down android app
body: <p>I am new to developing android apps. I am making an app where simple object moves. The problem is with the background. When I put code like this:</p>
  
  <pre><code>protected void onDraw(Canvas canvas) {
      BackGround1 = BitmapFactory.decodeResource(getResources(), R.drawable.lightning1);
      canvas.drawBitmap(BackGround1, 0, 0, null);
      canvas.drawCircle(xp, yp, circleRadius, circlePaint);
  }
  </code></pre>
  
  <p>the moving object (circle) slows down significantly and after a while (like 20 seconds) there start to appear traces from circle and after that (~10 seconds) it "crashes" and goes back to previous activity.</p>
  
  <p>If I put<br>
  <code>canvas.drawColor(Color.BLACK);</code><br>
  instead of<br>
  <code>canvas.drawBitmap(BackGround1, 0, 0, null);</code> then everything works fine. lightning1 is 480x800 jpg image.<br>
    Can anyone tell me what I am doing wrong?</p>
  
  <pre><code>04-11 02:00:50.722: ERROR/dalvikvm-gc(13262): Could not create 1097728-byte ashmem mark stack: Too many open files
  04-11 02:00:50.722: ERROR/dalvikvm-heap(13262): dvmHeapBeginMarkStep failed; aborting
  04-11 02:00:50.722: ERROR/dalvikvm(13262): VM aborting
  04-11 02:00:50.902: ERROR/ActivityManager(92): fail to set top app changed!
  </code></pre>