title: Button with ImageView is not clickable in a Relative Layout inside a Table Layout wrapped in Linear Layout
body: <p>I am unable to click. I tried making Relative Layout clickable and focusable and Button &amp; ImageView not clickable and not focusable but it is not working. I tried setting click event on both button and Layout. Nothing is working.
  Following is the main_activity.xml file</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.LinearLayoutCompat
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.knit.cdc_knit.MainActivity"
      android:orientation="vertical"&gt;
              &lt;TableLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
                  &lt;TableRow
                      android:layout_width="fill_parent"
                      android:layout_height="0dp"
                      android:weightSum="1"
                      android:layout_weight="0.5"&gt;
                      &lt;RelativeLayout
                          android:id="@+id/knit_layout"
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"
                          &gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/aboutKnit"
                              android:background="@drawable/line_right_bottom_trans"
                              android:text="@string/aboutKnit"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"
                              /&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/college"
                              android:layout_centerInParent="true"
                              /&gt;
                      &lt;/RelativeLayout&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/aboutCdc"
                              android:background="@drawable/line_bottom_trans"
                              android:text="@string/aboutCdc"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/depart"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                  &lt;/TableRow&gt;
                  &lt;TableRow
                      android:layout_width="fill_parent"
                      android:layout_height="0dp"
                      android:weightSum="1"
                      android:layout_weight="0.5"&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/record"
                              android:background="@drawable/line_right_bottom_trans"
                              android:text="@string/record"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/record"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/company"
                              android:background="@drawable/line_bottom_trans"
                              android:text="@string/company"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/company"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                  &lt;/TableRow&gt;
                  &lt;TableRow
                      android:layout_width="fill_parent"
                      android:layout_height="0dp"
                      android:weightSum="1"
                      android:layout_weight="0.5" &gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/training"
                              android:background="@drawable/line_right_bottom_trans"
                              android:text="@string/training"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/training"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/internship"
                              android:background="@drawable/line_bottom_trans"
                              android:text="@string/internship"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/intern"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                  &lt;/TableRow&gt;
                  &lt;TableRow
                      android:layout_width="fill_parent"
                      android:layout_height="0dp"
                      android:weightSum="1"
                      android:layout_weight="0.5"&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/personality"
                              android:background="@drawable/line_right_trans"
                              android:text="@string/personality"
                              android:textSize="14sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/gallery"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                      &lt;RelativeLayout
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="0.5"&gt;
                          &lt;Button
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:id="@+id/team"
                              android:background="@drawable/transparent"
                              android:text="@string/team"
                              android:textSize="15sp"
                              android:textColor="@color/fontColor"
                              android:gravity="center|bottom"
                              android:singleLine="false"
                              android:paddingBottom="10dp"/&gt;
                          &lt;ImageView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:src="@drawable/team"
                              android:layout_centerInParent="true"/&gt;
                      &lt;/RelativeLayout&gt;
                  &lt;/TableRow&gt;
              &lt;/TableLayout&gt;
  
  &lt;/android.support.v7.widget.LinearLayoutCompat&gt;
  </code></pre>
  
  <p>Here is java code:</p>
  
  <pre><code>    package com.knit.cdc_knit;
  
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.RelativeLayout;
  
  public class MainActivity extends AppCompatActivity {
      Button btnKnit, btnCdc, btnRecord, btnCompany, btnTraining, btnintern, btnGallery, btnTeam;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
      public void onClickButtonListener(){
          btnKnit = findViewById(R.id.aboutKnit);
          RelativeLayout knitlayout = findViewById(R.id.knit_layout);
          knitlayout.setOnClickListener(
                  new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          Intent iknit = new Intent(MainActivity.this, AboutKnit.class);
                          startActivity(iknit);
                      }
                  }
          );
      }
  }
  </code></pre>
  
  <p>Here is AndroidManifest.xml:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.knit.cdc_knit"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
  
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".AboutKnit"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.AboutKnit" /&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;activity android:name=".AboutCdc"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.knit.cdc_knit.AboutCdc" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>My Layout looks like:
  <a href="https://i.stack.imgur.com/y72Am.png" rel="nofollow noreferrer">This is main_activity.xml</a></p>