title: Android - ListView with Spinner - cannot select the list item (as a whole)
body: <p>In a ListView each row contains 1 textview and 1 spinner. 
  The spinner works fine. </p>
  
  <p>How can I select the complete list row? So, click on it and do some action? </p>
  
  <p>I tried both m_listview.setOnItemClickListener( new OnItemClickListener() { ... and registering a longclick/context menu. 
  On clicking / longclicking ... these methods / listeners are never called. </p>
  
  <p>A similar question was solved by putting "android:focusable="false" and       android:focusableInTouchMode="false"" for the button. 
  The button works, the list item (row) can be selected. Great. 
  This solution does not work for a list row with a spinner in it. </p>
  
  <p>So, I replaced the spinner with a button, again added the "focusable=false". It then works fine for the button. Changing it back to a spinner, nope, the row cannot be selected.  </p>
  
  <p>On request the most relevant parts of the code: </p>
  
  <p>1 - the rowlayout: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
    &lt;TextView
        android:id="@+id/variable_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:singleLine="true"
        android:text=""
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:textSize="12sp" /&gt;
  
       &lt;Spinner
          android:id="@+id/variable_use_answer"
          android:layout_width="120dp"
          android:layout_height="wrap_content"
          android:layout_marginLeft="5dp"
          android:entries="@array/variables_use_answers_short"
          android:focusable="false"
          android:focusableInTouchMode="false"
          android:textSize="12sp" /&gt;
   etc. 
  </code></pre>
  
  <p>2 - the fragment with the list and other textviews and buttons: </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingRight="10dp" &gt;
  
  &lt;ListView
      android:id="@+id/variables_list"
      android:layout_width="fill_parent"
      android:layout_height="0dip"
      android:layout_alignParentTop="true"
      android:layout_margin="5dp"
      android:layout_weight="1"
      android:scrollbars="vertical" /&gt;
  
  &lt;LinearLayout
      android:id="@+id/variables_buttons"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:orientation="horizontal"
      android:padding="4dp" &gt;
      &lt;Button
          android:id="@+id/waypoint_action"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="12dp"
          android:text="Action A" /&gt;
     etc. 
  </code></pre>
  
  <p>3 - most important part of the adapter code: </p>
  
  <pre><code>@Override
  public View getView(int position, View concertView, ViewGroup parent) {
      View view = null;
      if (concertView == null) {
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          view = inflater.inflate(R.layout.waypoint_rowlayout, parent, false);
      } else { 
          view = (LinearLayout) concertView;
      }
      variableV = (TextView) view.findViewById( R.id.variable_name);
      useAnswerV = (Spinner) view.findViewById( R.id.variable_use_answer);
      useAnswerV.setOnItemSelectedListener( new OnItemSelectedListener() {
          @Override
          public void onItemSelected( AdapterView&lt;?&gt; parent, View view, int position, long id) {
              System.out.println( "Item: " + parent.getItemAtPosition( position).toString());
          }
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; parent) { };
      }); 
      return view;
  }
  </code></pre>
  
  <p>4 - the fragment code (surrounding code)</p>
  
  <pre><code>onCreateView 
      ... 
      m_listview = (ListView) rootView.findViewById(R.id.variable_list);
      ... 
      adapter = new VariableAdapter( getActivity(), varList);
      m_listview.setAdapter( adapter);
      m_listview.invalidateViews();
      ....
      m_listview.setOnItemClickListener( new OnItemClickListener() {
           @Override
           public void onItemClick( AdapterView&lt;?&gt; a, View v, int position, long id) {
               // -----&gt; N*E*V*E*R   C*O*M*I*N*G H*E*R*E* &lt;----------- 
               VariableInfo var = (VariableInfo) m_listview.getAdapter().getItem( position);
               System.out.println( "Variable clicked on: " + var );
      });       
  </code></pre>