title: How to detect when finger slides off the ImageButton?
body: <p>I have an Imagebutton and I setColorFilter on ActionDOWN, but if user Slide the finger off the ImageButton, it remains with setColorFilter applied.</p>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li><p>How to detect when finger slides off? Then I can apply setColorFilter(null);</p>
  
  <p>ImageButton i1 = (ImageButton)v.findViewById(R.id.imageButton1);
           i1.setOnTouchListener(new OnTouchListener() {</p>
  
  <pre><code>        @Override
          public boolean onTouch(View v, MotionEvent event) {
              // TODO Auto-generated method stub
              ImageButton button = (ImageButton)v;
              String principal = "principal";
              if (event.getAction() == MotionEvent.ACTION_DOWN) {
                  button.setColorFilter(0x8066bbdd);
                  return true;
              } else if (event.getAction() == MotionEvent.ACTION_UP) {
                  button.setColorFilter(null);
                  Intent i = new Intent(getActivity(), SubView.class);
                  i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  i.putExtra("query", principal);
                  startActivity(i);
                  return true;
              }
              return false;
          }
      });
  </code></pre></li>
  </ul>