Onclick event not working in android
<p>I have written a code to enter some text using button click events in android. It is not working at all. Not giving any error or exception,i am not getting where it is all going wrong.</p>

<pre><code>public void onCreate(Bundle savedInstanceState)
{

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    //select_btn = (Button) findViewById(R.id.ok);
    //home_btn = (Button) findViewById(R.id.home);
    et = (EditText) findViewById(R.id.entry);
    et.setText("", TextView.BufferType.EDITABLE );
    b = new Bundle();

    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].setOnClickListener(this);          
    }       
    //tts.speak("hello wolrd",TextToSpeech.QUEUE_FLUSH,null);
    et.setText("hello man", TextView.BufferType.EDITABLE );     
}

public void onClick(View v)
{

    //while(tts.isSpeaking());
    et.setText("hello android", TextView.BufferType.EDITABLE );
    String s=null;
    s = ((Button)v).getText().toString().trim();
    //tts.speak("hello google",TextToSpeech.QUEUE_FLUSH,null);      
}
</code></pre>

<p>here is the main.xml :</p>

<pre><code>&lt;EditText
    android:id="@+id/entry"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:inputType="phone"
    android:maxLength="20" /&gt;

&lt;TableLayout
    android:id="@+id/table"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/entry"
    android:layout_marginTop="20dp"
    android:stretchColumns="*" &gt;

    &lt;TableRow&gt;

        &lt;Button
            android:id="@+id/btn0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/zero"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/one"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/two"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/three"
            android:textSize="10pt"
            android:visibility="visible" /&gt;
    &lt;/TableRow&gt;

    &lt;View
        android:layout_height="2dip"
        android:background="#FF909090" /&gt;

    &lt;TableRow&gt;

        &lt;Button
            android:id="@+id/btn4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/four"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/five"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/six"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn7"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/seven"
            android:textSize="10pt"
            android:visibility="visible" /&gt;
    &lt;/TableRow&gt;

    &lt;View
        android:layout_height="2dip"
        android:background="#FF909090" /&gt;

    &lt;TableRow&gt;

        &lt;Button
            android:id="@+id/btn8"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/eight"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn9"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/nine"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn10"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/delete"
            android:textSize="10pt"
            android:visibility="visible" /&gt;

        &lt;Button
            android:id="@+id/btn11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight=".25"
            android:clickable="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:text="@string/finish"
            android:textSize="10pt"
            android:visibility="visible" /&gt;
    &lt;/TableRow&gt;
&lt;/TableLayout&gt;

&lt;View
    android:id="@+id/view1"
    android:layout_width="fill_parent"
    android:layout_height="90dp"
    android:layout_below="@id/table" &gt;
&lt;/View&gt;
</code></pre>
