Android, TextWatcher event caught before OnItemClickListener event
<p>My text view (of type AutoCompleteTextView) listens to both TextWatcher and OnItemClickListener.  </p>

<p><code>
textView = (AutoCompleteTextView)
                findViewById(R.id.search_edit_text);</p>

<pre><code>    textView.setOnItemClickListener(this);
    textView.addTextChangedListener(this);
</code></pre>

<p></code>  </p>

<p>My objective is this: when a user enters a character the text view will display in the view's drop down list relevant items which contain the entered character (hereby task A). When a user chooses an item from the list I would like to save it (hereby task B).<br>
I perform task A within the scope of afterTextChanged(Editable text) and task B within the scope of onItemClick(AdapterView parent, View v, int position, long id).<br>
Task A works fine but when I choose an item from the list (and expect OnItemClick() to perform task B) afterTextChanged() is called (probably because the text has indeed changed) before OnItemClick() causing task A to run again.<br>
Any idea how to prevent this?
Thanks, Rob</p>
