title: Android autocomplete textview on click item
body: <p>I want to use <code>AutoCompleteTextview</code> for a <code>list</code> I have. I am using also an <code>Adapter</code> where I add the <code>list</code>. I want to print the element I click on. I use the following code but it does not work.</p>
  
  <pre><code>myAutoComplete.setOnItemClickListener(new OnItemClickListener() {
  
      String selected;
      boolean click = false;                  
      public void onItemClick (AdapterView&lt;?&gt; parentView,View selectedItemView,int position, long id) {
          //code
      }
  }
  </code></pre>
  
  <p>Also how to disable the ability to write in the <code>AutoCompleteTextview</code>? I don't want to write anything. I just want to print a list and select an element from it (including the first element).</p>
  
  <p>Here is the layout xml file.</p>
  
  <pre><code>&lt;AutoCompleteTextView
      android:id="@+id/myautocomplete"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_weight="0.95"
      android:background="@android:color/black"
      android:textColor="#FFFFFF" /&gt;
  </code></pre>
  
  <p>Any help is appreciated.</p>