title: Android ListView item highlight programmatically
body: <p>I know it's been asked around but I haven't found quite the answer yet (new to Android so sorry about the ignorance)</p>
  
  <p>my app's launch Activity has an EditText (called searchbox) , a ListView (designations) and a Spinner (types)</p>
  
  <p>I use the EditText as a searchbox, I have to pass the string through a custom editing to make searching more flexible. After that I match that against the closest approximation I find in 'designations' and do </p>
  
  <pre><code>designations.setSelection(j);
  </code></pre>
  
  <p>As expected, this sets the desired item to the top of designations. But I can't find a way to highlight it via code.</p>
  
  <p>NOW, i do know that if the device is in touch mode the highlighting of a selected item won't occur. So the last 4 lines of my searchbox's onTextChanged event are:</p>
  
  <pre><code>        designations.setFocusable(true);            
          designations.setFocusableInTouchMode(true);
          if (match==true)      designations.setSelection(j);
          if (st.length()==0)   designations.setSelection(0);
  </code></pre>
  
  <p>to no avail.</p>
  
  <p>now, i don't have any code on searchbox's afterTextChanged(Editable s);</p>
  
  <p>so could anyone give me a clue on this?</p>
  
  <p>regards
  ~dh</p>