title: Android Motion Event
body: <p>I am trying the android motion event. However, I do not know why it cant go to > case MotionEvent.ACTION_MOVE:</p>
  
  <p>Here is my codes.</p>
  
  <pre><code>@Override
  public boolean onTouch(View v, MotionEvent event) {
  
      int action = event.getAction();
      switch (action){
          case MotionEvent.ACTION_DOWN:
  
              startX = (int)event.getX();
              startY = (int)event.getY();
              selecting=false;
              break;
          case MotionEvent.ACTION_MOVE:
              selecting=true;
              break;
          case MotionEvent.ACTION_UP:
              if(selecting){
                  endX = (int)event.getX();
                  endY = (int)event.getY();
                  selected=true;
              }
              selecting=false;
              break;
  
      }
  }
  </code></pre>
  
  <p>No matter how I swipe and touch, even if I remove if(selecting) condition in case MotionEvent.ACTION_UP, it always show same output.</p>
  
  <blockquote>
    <p>start: {498.0, 365.0}<br>
    end: {0.0, 0.0}<br>
    selecting: false<br>
    selected: false</p>
  </blockquote>
  
  <p>After I change it to </p>
  
  <blockquote>
    <p>public boolean onTouchEvent(MotionEvent event)</p>
  </blockquote>
  
  <p>everything is okay. Can anyone explain to me why does it happen?</p>
  
  <p>If possible, help me to solve this problem too. <a href="https://stackoverflow.com/questions/34988449/how-to-get-the-actual-point-when-i-touch-on-screen">How to get the actual point when I touch on screen?</a></p>