Drawing to an existing view
<p>How do I add, say, a line to an already drawn view?</p>

<p>I tried grabbing the canvas from the draw method and using it to draw to, but it doesn't seem to be working.</p>

<pre><code>protected void onDraw(Canvas canvas) {

   super.onDraw(canvas);
   mCanvas = canvas;
       //drawing code here
}

 public boolean onTouchEvent(MotionEvent event) {

    switch (event.getAction()) {
       case MotionEvent.ACTION_DOWN: {
             Paint paint = new Paint();
             paint.setColor(Color.BLACK);
             paint.setStrokeWidth(10);
             paint.setStyle(Style.FILL);
             mCanvas.drawLine(0, 0, 50, 50, paint);
      }
   }

 }
</code></pre>
