title: On Touch Listener does not release button when finger is moved Android
body: <p>I have a <code>RelativeLayout</code> with 15 buttons, I am working on a new project and with <code>OnTouchListener</code>, I want my app to do something like this: When user touches for example button 1, Mp1 will start playing until user lift his finger or move it to button 2, then mp2 on button 2 should start and so on.</p>
  
  <p>But here is what happens, part where user touches the screen and lift is working fine, but if user move his finger(not lift) if button 1 was pressed it will still be in pressed state (action down) until user lift his finger. 
  Something like this:
  <img src="https://i.stack.imgur.com/FIy5k.png" alt="enter image description here"></p>
  
  <p>My question:</p>
  
  <p>What I need to add to when finger leave button border to stop the button and switch on whichever button is pressed(where finger is touching)?
  My code:</p>
  
  <pre><code>sound1.setOnTouchListener(new OnTouchListener() {
              public boolean onTouch(View v, MotionEvent event) {
                  if (event.getAction() == android.view.MotionEvent.ACTION_DOWN) {
                      pressed1 = true;
                      mp1 = MediaPlayer.create(MainClass.this, R.raw.item1);
                      mp1.start();
                      sound1.setBackgroundResource(R.drawable.pad_pressed);
                      if (looping == true) {
                          mp1.setLooping(true);
                      } else if (looping == false) {
                          mp1.setLooping(false);
                      }
  
                  } else if (event.getAction() == android.view.MotionEvent.ACTION_UP) {
                      pressed1 = false;
                      mp1.stop();
                      mp1.reset();
                      mp1.release();
                      sound1.setBackgroundResource(R.drawable.pad_normal);
                  }
                  return true;
              }
          });
  </code></pre>