title: Android: AutoCompleteTextView hide soft keyboard
body: <p>I have an AutoCompleteTextView which as usual provides suggestions after a user types 3 letters. I want once once I touch the suggestion list to hide the soft keyboard. 
  What I have done below with the table layout hides the keyboard only when clicking anywhere but the suggestion list.</p>
  
  <p>XML</p>
  
  <pre><code>&lt;TableRow
      android:id="@+id/tableRow2"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:gravity="center" &gt;
  
      &lt;AutoCompleteTextView
          android:id="@+id/auto_insert_meds"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:ems="15"
          android:inputType="textVisiblePassword|textMultiLine"
          android:scrollHorizontally="false"
          android:text=""
          android:textSize="16sp" /&gt;
  &lt;/TableRow&gt;
  </code></pre>
  
  <p>Java</p>
  
  <pre><code>TableLayout tbl = (TableLayout) findViewById(R.id.main_table);
  tbl.setOnTouchListener(new OnTouchListener() {
  
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
          in.hideSoftInputFromWindow(v.getWindowToken(), 0);
          return true;
      }
  });
  </code></pre>
  
  <p>XML for custom list</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/medlist_linear_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" &gt;
  
          &lt;TextView
          android:id="@+id/med_name"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:scrollHorizontally="false"
          android:padding="3dp"
          android:textColor="@android:color/white" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>