title: How to get correct ID of AutoCompleteTextView adapter
body: <p>I am new to Android development and I ran into a problem which I find difficult to solve. I am trying to figure out how to use an <code>AutoCompleteTextView</code> widget properly. I want to create a <code>AutoCompleteTextView</code>, using XML data from a web service. I managed to get it to work, but I am defenitely not pleased with the output.</p>
  
  <p>I would like to put a <code>HashMap</code> with id => name pairs into the AutoCompleteTextView and get the id of the clicked item. When I click on the autocomplete filtered set output, I want to populate a list underneath the autocompletion box, which I also managed to get to work.</p>
  
  <p>Done so far:</p>
  
  <ul>
  <li>autocomplete works well for simple <code>ArrayList</code>, all data filtered
  correct</li>
  <li><code>onItemClick</code> event fires properly after click</li>
  <li><code>parent.getItemAtPosition(position)</code> returns correct <code>String</code>
  representation of the clicked item</li>
  </ul>
  
  <p>The event <code>onItemClick(AdapterView parent, View v, int position, long id)</code> does not behave as I would like. How can I figure out the unfiltered array position of the clicked item? The position of the filtered one is the one I am not interested in.</p>
  
  <p>Further questions:</p>
  
  <ul>
  <li>How to handle <code>HashMaps</code> or <code>Collections</code> in <code>AutoCompleteTextView</code></li>
  <li>How to get the right <code>itemId</code> in the <code>onItemClick</code> event</li>
  </ul>
  
  <p>I did very extensive research on this issue, but did not find any valuable information which would answer my questions.</p>