title: LinearLayout not clickable - Android
body: <p>I know this is a question that has been asked before, but I think I'm doing the correct coding, and yet, I'm not coming up with the proper result. Here my xml code:</p>
  
  <pre><code>            &lt;LinearLayout 
                  android:id="@+id/directions_layout"
                  android:orientation="horizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="50dp"
                  android:clickable="true"&gt;
  
                  &lt;ImageView android:src="@drawable/icon_directions"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical"
                      android:layout_marginLeft="5dp"/&gt;
  
                  &lt;TextView android:text="Directions"
                      android:textColor="@color/gray"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical"
                      android:layout_marginLeft="10dp"/&gt;
  
              &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I don't know if this makes a difference or not, but the LinearLayout that is the parent of the one shown is not clickable.</p>
  
  <p>Here is where I set the OnClickListener in the code:</p>
  
  <pre><code>    listener_layout = new OnClickListener(){
  
          @Override
          public void onClick(View v) {
              Toast.makeText(v.getContext(), "hi", Toast.LENGTH_SHORT);
  
          }
  
      };
      call_layout = (LinearLayout) findViewById(R.id.call_layout);
      call_layout.setOnClickListener(listener_layout);
  </code></pre>
  
  <p>but it never get fired...Any suggestions?</p>