Class cast exception by onclick listener in android
<p>I have written a code to implement onclick events of buttons in android.
I have written the following line to set the listener in oncreate method.
I want to recognize the touch event of a button in the application.i am getting a class cast exception in android.</p>

<p>mybtn[i].setOnClickListener( (OnClick Lisener)this);</p>

<p>for the alternatives to recognize the ontouch event i have looked at the SetKeylistener() , setonkeylistener() and setontouchlistener() methods. but i am not getting which one to use exactly.</p>

<p>What exactly i want to achieve is TTS should speak the number when the button is touched, and on the key release that number should be added to some textbox. so what methods should i use to accomplish these things.</p>
