title: Limit Touchevent to one time
body: <p>how can I limit the Touchevent to one/ two time(s), that means the user can only do one time a touchevent.</p>
  
  <p>Here is the code from the Touchevent, I dont know how I should edit it, that the touchevent only react one or two times.</p>
  
  <pre><code>   @Override
   public boolean onTouchEvent(MotionEvent event) {
      float currentX = event.getX();
      float currentY = event.getY();
      float deltaX, deltaY;
      float scalingFactor = 15.0f / ((box.xMax &gt; box.yMax) ? box.yMax : box.xMax);
      switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN:
      deltaX = currentX - previousX; //vorherig(previous)  - aktuell
            deltaY = currentY - previousY;
            ball.speedX += deltaX * scalingFactor;
            ball.speedY += deltaY * scalingFactor;
        break;              
      case MotionEvent.ACTION_UP:
          // Modify rotational angles according to movement
  
      }
      // Save current x, y
      previousX = currentX;
      previousY = currentY;
      return true;  // Event handled
   }
  </code></pre>