MotionEvent up doesn't work outside of button
<p>I have an ImageButton when i press it and keep my finger down it becomes invisible, when i lift my finger it becomes visible again.</p>

<p>But when i press the button and while my finger is down i move it away from it and lift it up it doesn't become visible again</p>

<p>The code looks like this</p>

<pre><code>final ImageButton b=(ImageButton)findViewById(R.id.timer_btn);

        b.setOnTouchListener(new View.OnTouchListener() {

        public boolean onTouch(View v, MotionEvent event) {
                switch (event.getAction()) {

                  case MotionEvent.ACTION_UP: 
                        b.setVisibility(View.VISIBLE);
                        Log.w("app", "Action up");
                        return true;
                  case MotionEvent.ACTION_DOWN: 
                        b.setVisibility(View.INVISIBLE);
                        Log.w("app", "Action down");

                       }
                    return false;
            }
        });
</code></pre>

<p>I tried using </p>

<pre><code>case MotionEvent.ACTION_OUTSIDE: 
                            b.setVisibility(View.VISIBLE);
                            Log.w("app", "Action outside");

                           }
</code></pre>

<p>but it doesn't work, it gets called no matter if it's outside the button or inside</p>
