onClick in TextView doesnt work


  1. Markus Taubek

    Markus Taubek Member

    Hello,

    I want a Menu with Textview to click it and react.

    There is my TextView:
    Code (Text):
    <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="40px"
                    android:text="MyLink"
                    android:onClick="onClickMyLink"
                    android:textColor="@color/white"
                    android:padding="8px"
                    style="@style/home_menu"/>
    There is my listener method:
    Code (Text):
    public void onClickMyLink(final View sfNormal) {
    But If I click on the Text, it is not call my method.
    The same method is working with a <button> tag
    but not with my TextView.

    Anybody an idea?

    greets
    Markus

    Advertisement
    :
  2. two things:

    1. Clickable views should come with an ID to identify them

    2. It's not clickable without android:clickable="true"
  3. Markus Taubek

    Markus Taubek Member

    Thanks.. android:clickable is the attribut what I searched.

    greets
    Markus
Loading...

Share This Page