title: TextView onClick() not working
body: <p>here's my code for main.xml</p>
  
  <pre><code> &lt;merge xmlns:android="http://schemas.android.com/apk/res/android"&gt;
   &lt;RelativeLayout 
      android:id="@id/container" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  
  &lt;include layout="@layout/tabs" /&gt;
  
  &lt;ScrollView
      android:fillViewport="true" 
      android:scrollbars="@null"
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"&gt;
  
      &lt;LinearLayout 
          android:paddingTop="10dp"
          android:layout_width="fill_parent" 
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;!-- first text_view --&gt;
          &lt;TextView 
              android:background="@color/grey"
              android:textColor="@color/white"
              android:text="@string/category" 
              android:id="@+id/category1" 
              android:layout_height="wrap_content" 
              android:layout_width="fill_parent"
              android:layout_marginTop="65dp" 
              android:textSize="17dp"
              android:typeface="serif"/&gt;
  
          &lt;!-- first horizontal_scrollview --&gt;
          &lt;HorizontalScrollView 
              android:scrollbars="@null"
              android:id="@+id/horizontalScrollView1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
  
              &lt;LinearLayout android:id="@+id/linearLayout1"
                  android:orientation="horizontal" 
                  android:visibility="visible"
                  android:layout_height="wrap_content"
                  android:layout_width="wrap_content"&gt;
  
                  &lt;!-- image_view should be here --&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/HorizontalScrollView&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  &lt;/RelativeLayout&gt;
  &lt;/merge&gt;
  </code></pre>
  
  <p>here's my code for tabs.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:orientation="horizontal" 
  android:background="#333333"&gt;
  
  &lt;TextView
      android:textColor="@color/gradient_green"
      android:id="@+id/viewall"
          android:layout_width="85dp"
          android:layout_height="25dp"
          android:layout_marginLeft="10dp"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:textSize="17dp"
          android:textStyle="bold" 
          android:text="@string/view_all"
          android:onClick="onClick"
          android:focusable="false"
          android:clickable="true" /&gt;
  
      &lt;TextView
          android:textColor="@color/white"
          android:id="@+id/pic"
          android:layout_width="45dp"
          android:layout_height="25dp"
          android:layout_alignParentTop="true"
          android:layout_toRightOf="@+id/viewall"
          android:textSize="17dp"
          android:textStyle="bold" 
          android:text="@string/pic"
          android:onClick="onClick"
          android:focusable="false"
          android:clickable="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and here's the code inside the Main.java:</p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      TextView all = (TextView) this.findViewById(R.id.viewall);
      TextView pic = (TextView) this.findViewById(R.id.pic);
  
      all.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              TextView all = (TextView) findViewById(R.id.viewall);
              TextView pic = (TextView) findViewById(R.id.pic);
  
              Toast.makeText(Main.this, "VIEW ALL", Toast.LENGTH_SHORT).show();
  
              all.setTextColor(getResources().getColorStateList(R.color.gradient_green));
              pic.setTextColor(getResources().getColorStateList(R.color.white));
          }
      });
  
      pdf.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              TextView all = (TextView) findViewById(R.id.viewall);
              TextView pic = (TextView) findViewById(R.id.pic);
  
              Toast.makeText(Main.this, "VIEW ALL", Toast.LENGTH_SHORT).show();
  
              all.setTextColor(getResources().getColorStateList(R.color.white));
              pic.setTextColor(getResources().getColorStateList(R.color.gradient_green));
          }
      });
  
    }
  </code></pre>
  
  <p>so, if I set the setContentView() in the Main.class or Main.java as setContentView(R.layout.tabs) instead of setContentView(R.layout.main), the onClick() works, what should I do or what's wrong with my code that hinders onClick() not to work?</p>