Dynamically updating an AutoCompleteTextView adapter
<p>I want to periodically change the suggestions given by an AutoCompleteTextview by getting the list from a RESTful web service, and can't get it working smoothly. I set up a hard-coded list of suggestions to make sure it's working:</p>

<pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, new String[] {"Hi", "Ho"});
speciesName.setAdapter(adapter);//my autocomplete tv
</code></pre>

<p>I have got a TextWatcher on the textview and when the text changes that launches a non-blocking call to get a new list of suggestions -- this part which gets a new list is working fine. Then I want to reset the adapter, like so:</p>

<pre><code>public void setOptionsAndUpdate(String[] options) {
    Log.d(TAG, "setting options");
    //speciesName.setAdapter((ArrayAdapter&lt;String&gt;)null);
    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, options);
    speciesName.setAdapter(adapter);
}
</code></pre>

<p>This method is called, but doesn't work -- the list of suggestions either disappears or the displayed suggestions remain unchanged despite the call to <code>setAdapter</code>.</p>

<p>Is this even the right approach? I looked at <code>SimpleCursorAdapter</code> but couldn't see how to register my web service as a content provider. (It's of the form <a href="http://www.blah.com/query?term=XX">http://www.blah.com/query?term=XX</a>, where the XX is the input from my app, and the response is a JSON Array of strings.)</p>
