title: My onTouch method is not doing its proper fucntion
body: <p>I am making a Android app. The objective is to make circles that when touched something happens. Here is the onTouch method</p>
  
  <pre><code>public boolean onTouch(View v, MotionEvent event) {
     int x = (int) event.getX();
     int y = (int) event.getY();
     if(isInsideCircle(x, y) ==  true){
        //Do your things here
         if(redColor == lastColor){
            Intent i = new Intent(v.getContext(), YouFailed.class);
            v.getContext().startActivity(i);
         } else {
             addPoints++;
         }
     }else {
  
     }
     return true;
  }
  </code></pre>
  
  <p>This part of the code is the thing that is not functioning properly here is the entire class below.</p>
  
  <pre><code>public class DrawingView extends View{
  
  
  
      public DrawingView(Context context) {
          super(context);
          // TODO Auto-generated constructor stub
  
      }
      RectF rectf = new RectF(0, 0, 200, 0);
  
      private static final int w = 100;
      public static int lastColor = Color.BLACK;
      private final Random random = new Random();
      private final Paint paint = new Paint();
      private final int radius = 230;
      private final Handler handler = new Handler();
      public static int redColor = Color.RED;
      public static int greenColor = Color.GREEN;
      int randomWidth = 0;
      int randomHeight = 0;
      public static int addPoints = 0;
  
  
      private final Runnable updateCircle = new Runnable() {
          @Override 
          public void run() {
              lastColor = random.nextInt(2) == 1 ? redColor : greenColor;
              paint.setColor(lastColor);
              invalidate();
              handler.postDelayed(this, 1000);
  
          }
      };
  
      @Override 
      protected void onAttachedToWindow() {
          super.onAttachedToWindow();
          handler.post(updateCircle);
      }
  
      @Override 
      protected void onDetachedFromWindow() {
          super.onDetachedFromWindow();
          handler.removeCallbacks(updateCircle);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
          // your other stuff here
          if(random == null){
              randomWidth =(int) (random.nextInt(Math.abs(getWidth()-radius/2)) + radius/2f);
              randomHeight = (random.nextInt((int)Math.abs((getHeight()-radius/2 + radius/2f))));
          }else {
              randomWidth =(int) (random.nextInt(Math.abs(getWidth()-radius/2)) + radius/2f);
              randomHeight = (random.nextInt((int)Math.abs((getHeight()-radius/2 + radius/2f))));
          }
  
          canvas.drawCircle(randomWidth, randomHeight + radius/2f, radius, paint);
  
          paint.setColor(Color.BLACK);
          paint.setTextSize(150);
          canvas.drawText("Score: " + addPoints, 120, 300, paint);
      }
  
      public boolean onTouch(View v, MotionEvent event) {
     int x = (int) event.getX();
     int y = (int) event.getY();
     if(isInsideCircle(x, y) ==  true){
        //Do your things here
         if(redColor == lastColor){
            Intent i = new Intent(v.getContext(), YouFailed.class);
            v.getContext().startActivity(i);
         } else {
             addPoints++;
         }
     }else {
  
     }
     return true;
  }
  
  public boolean isInsideCircle(int x, int y){
    if ((((x - randomWidth)*(x - randomWidth)) + ((y - randomHeight)*(y - randomHeight))) &lt; ((radius)*(radius)))
      return true;
    return false;    
  }
  
  
  
  
  
  
  
  
  
  
  
  }
  </code></pre>