Ontouch event not working
<p>i have a programme which has the following layout,</p>

<p>a b  c d
e f g h</p>

<p>and one text box.
when the button 'a' is touched the text should set to "a down". it is working fine. but before the finger is taken off from 'a' suppose the user slides/drags to 'b' , then it should cancel the up event of 'a' and should take "down" event of B. the text should set to "down B".when the user still slides to 'C' then b down should get as well canceled and when only key released then that corresponding selected keys up event should occur.</p>

<p>but it is not happening, it is still in "a down". *<em>i want the up event of a to be canceled and the down event of b should be recognized *</em>. how it can be achieved, please give me ideas and if possible sample code. i really need it urgent. </p>

<p>here is my code</p>

<pre><code>for (int i = 0; i &lt; mybtn.length; i++) 
  {

            String btnid = "btn" + i;

            int resid = getResources().getIdentifier(btnid, "id",
                    getPackageName());

            mybtn[i] = (Button) findViewById(resid);

            mybtn[i].setOnTouchListener(this);


   }



public boolean onTouch(View v, MotionEvent event) 
{

        // TODO Auto-generated method stub

        String s = null;

        s = ((Button) v).getText().toString().trim();


        switch (event.getAction()) {
        // case MotionEvent.ACTION_MOVE:
        // Do some stuff
        // et.setText("move android"+s, TextView.BufferType.EDITABLE );
        // break;

        case MotionEvent.ACTION_DOWN:
            current = Integer.valueOf(s);
            et.setText("down android" + s, TextView.BufferType.EDITABLE);
            // Do some stuff
            break;
        case MotionEvent.ACTION_UP:
            et.setText("up android" + s, TextView.BufferType.EDITABLE);
            break;
        case MotionEvent.ACTION_MOVE:
            if (current != Integer.valueOf(s)) {
                current = Integer.valueOf(s);
            }
            break;

        }

        return false;
    }

}
</code></pre>
