title: ListViews inside TableLayout
body: <p>I have posted the same question on google's android-developer's forum.
  I am repeating here:</p>
  
  <p>I have a TableLayout with one TableRow.
  The first column/cell is a ListView. The second cell/column is a
  TableLayout again which consists of 2 ListViews.</p>
  
  <p>When i inflate the xml layout, everything looks fine and i have set of
  adapters for each of the 3 ListViews.</p>
  
  <p>I have added dummy elements into these lists via adapters and am able
  to scroll up and down the list.</p>
  
  <p>But the onItemClick is not getting triggered.</p>
  
  <p>The following is my layout file -</p>
  
  <p></p>
  
  <pre><code>   &lt;RelativeLayout android:id="@+id/top_header"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"&gt;
             &lt;Button
                     android:text="Edit"
                     android:id="@+id/button1"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"&gt;
             &lt;/Button&gt;
             &lt;TextView
                     android:text="dummy1"
                     android:textStyle="bold"
                     android:id="@+id/textView3"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_toRightOf="@+id/button1"
                     android:layout_centerVertical="true"
                     android:paddingLeft="25dip"
                     android:textSize="18dip"&gt;
             &lt;/TextView&gt;
             &lt;Button
                     android:id="@+id/button2"
                     android:layout_alignParentTop="true"
                     android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:text="Cancel"
                     android:layout_alignParentRight="true"&gt;
             &lt;/Button&gt;
             &lt;TextView
                     android:layout_alignParentTop="true"
                     android:text="dummy2"
                     android:textStyle="bold"
                     android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:id="@+id/textView4"
                     android:layout_toLeftOf="@+id/button2"
                     android:layout_centerVertical="true"
                     android:paddingRight="25dip"
                     android:textSize="18dip"&gt;
             &lt;/TextView&gt;
     &lt;/RelativeLayout&gt;
  
     &lt;TableLayout android:id="@+id/tableLayout1"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:shrinkColumns="1"&gt;
  
         &lt;TableRow android:id="@+id/tableRow1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:divider="@android:color/black"
             android:dividerPadding="2dip"&gt;
             &lt;ListView
                     android:id="@+id/listView1"
                     android:layout_height="wrap_content"
                     android:layout_width="0dip"
                     android:layout_weight="1"
                     android:clickable="true"
                     android:focusable="true"
                     &gt;
             &lt;/ListView&gt;
             &lt;TableLayout android:id="@+id/tableLayout2"
                     android:layout_width="0dip"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:shrinkColumns="1"&gt;
                 &lt;TextView
                     android:text="dummy3"
                     android:id="@+id/textView1"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textStyle="bold"
                     android:padding="8dip"
                     android:textSize="18dip"
                     android:background="#ff238E23"&gt;
                 &lt;/TextView&gt;
                 &lt;ListView
                     android:id="@+id/listView2"
                     android:layout_height="0dip"
                     android:layout_weight="1"
                             android:drawSelectorOnTop="false"
                             android:divider="@android:color/white"
                             android:dividerHeight="2dip"
                     android:layout_width="match_parent"
                             android:clickable="true"
                             android:focusable="true"
                     &gt;
                 &lt;/ListView&gt;
                 &lt;TextView
                     android:text="dummy4"
                     android:textSize="18dip"
                     android:textStyle="bold"
                     android:id="@+id/textView2"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:background="#ff0000ff"
                     android:padding="8dip"&gt;
                 &lt;/TextView&gt;
                 &lt;ListView
                     android:id="@+id/listView3"
                     android:layout_height="0dip"
                     android:layout_weight="1"
                             android:drawSelectorOnTop="false"
                             android:divider="@android:color/white"
                             android:dividerHeight="2dip"
                     android:layout_width="match_parent"
                             android:clickable="true"
                             android:focusable="true"
                     &gt;
                 &lt;/ListView&gt;
             &lt;/TableLayout&gt;
         &lt;/TableRow&gt;
  
     &lt;/TableLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>And in the java file, i do</p>
  
  <pre><code>   ListView lv = (ListView) findViewById(R.id.listView1);
     lv.setAdapter(new EfficientAdapterLeft(this));
     lv.setOnItemClickListener(new OnItemClickListener()
  </code></pre>
  
  <p>{
                         @Override
                         public void onItemClick(AdapterView arg0, View view, int arg2,
  long arg3) {
                                 Log.v("blah","arg2 " + arg2);
                                 Log.v("blah","arg3 " + arg3);
                         }
                 });</p>
  
  <p>I do similar things for the remaining two lists R.id.listView2 and
  R.id.listView4. They instantiate different adapters but nothing
  drastically different.</p>
  
  <p>I don't see the logs getting printed. Why am i unable to click on the
  items and get the onClickItem listener get triggered? Even doing this
         lv.setFocusable(true);
         lv.setClickable(true);
  does not help.</p>
  
  <p>Any idea what's happening?</p>
  
  <p>Thanks.</p>