title: drawing a circle where the user has touched on canvas
body: <p>Starting to learn Canvas and have two classes so far (main one to call the view and the view)
  The View class onDraw creates a target (ie number of cicles and each one coloured differently)</p>
  
  <p>I have a ontouch listenerer set up to record the x and y where the user clicks</p>
  
  <p>my trouble then is drawing a new circle / point where the user touches</p>
  
  <p>UPDATED with classes</p>
  
  <p>Main Class</p>
  
  <pre><code>public class StartScreen extends Activity {
  
      DrawView drawView;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          drawView = new DrawView(this);
          drawView.setBackgroundColor(Color.WHITE);
          setContentView(drawView);
  }
  </code></pre>
  
  <p>Draw Class</p>
  
  <pre><code>public class DrawView extends View implements View.OnTouchListener {
  
      private Paint paint[];
  
      private Context context;
      private Canvas canvas;
  
      //definging some variables
  
      public DrawView(Context pContext) {
          super(pContext);  
          this.context = pContext;
  
          WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
          Display display = wm.getDefaultDisplay();
  
          paint = new Paint[5];
          setupColours();
  
      // setting varibale like raduis etc
  
  
  
      }
  
      private void setupColours() {
  
          // Creating Arrray of Paint Colours
  
      }
  
      @Override
      public void onDraw(Canvas pCanvas) {
  
          canvas = pCanvas;
  
          newRadius = radius;
  
          for (int i = 0; i &lt; rings; i++) {
  
  
              if (i == 3) {
                  canvas.drawCircle(centreWidth, centreHeight, newRadius, paint[0]);
              } else {
                  canvas.drawCircle(centreWidth, centreHeight, newRadius, paint[1]);
              }
  
  
              canvas.drawCircle(centreWidth, centreHeight, newRadius - targetBoundary, paint[i / 2]);
  
              newRadius = newRadius - ringOffset;
  
          }
  
          this.setOnTouchListener(this);
  
      }
  
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          Log.d("TAG2", "x: " + event.getX() + " y: " + event.getY());
          drawHit(event.getX(), event.getY());
          return true;
      }
  
      public void drawHit(float hitX, float hitY) {
          Log.d("HIT", "Hit being drawn");
  
          Paint paint2 = new Paint();
          paint2.setColor(Color.BLACK);
  
          canvas.drawCircle(hitX, hitY, 100, paint2);
  
      }
  </code></pre>
  
  <p>The method is called but the circle is not being drawn. what am I doing wrong. Thanks</p>