title: Out Of Memory Error in Android Studio
body: <p>I'm trying to create my first android app, so I'm really new to android development. I'm trying to make a nice background image for my app. I made an image that is the exact dimensions of the device, but when I try to load it, i get the error "Failed to allocate a 218748 byte allocation with 217220 free bytes and 212KB until OOM" Here's my code:</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      drawBackground(canvas);
  
  protected void drawBackground(Canvas canvas) {
      Bitmap background = Bitmap.createBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.background2));
      canvas.drawBitmap(background, 0, 0, null);
  </code></pre>
  
  <p>I've tried scaling it down, which works, but then it doesn't fill the entire screen. How do I resolve this issue?</p>