title: Setting background image in a custom view
body: <p>I have created a class which extends View class.</p>
  
  <pre><code>public class SplashScreen extends View
  </code></pre>
  
  <p>and i use it by setting contentview</p>
  
  <pre><code>View splash = new SplashScreen(this);
  setContentView(splash);
  </code></pre>
  
  <p>I need to set background image but I can't use layout. I think I need to do canvas drawing but I don't know how to do.</p>
  
  <pre><code>protected void onDraw(Canvas canvas) {
    ballBounds.set(ballX-ballRadius, ballY-ballRadius, ballX+ballRadius, ballY+ballRadius);
    paint.setColor(Color.LTGRAY);
    // canvas.drawImage(R.drawable.background_image); (Ps: I know there is no function such as drawImage)"
    canvas.drawOval(ballBounds, paint);}
  </code></pre>