views:

438

answers:

1

I've been looking into the Android SDK's example of the SearchableDictionary for a while now, but I'm still not sure if that is the right approach.

The problem is, that I want to fill my hint list (see picture below) with data, which I will receive via a HTTP/JSON query. So I'm not sure if using a ContentProvider as used in the above example is the right thing to do. Can I access the hint list of the SearchBox in some way more direct?

alt text

A: 

You can overload the onSearchRequested for the searchmanager and return a custom data set the the given query. make sure to use an asyncTask if you are connecting to the web for your data to avoid ANR's

 @Override
 public boolean onSearchRequested() {
     Bundle appData = new Bundle();
     appData.put...();
     ...
     startSearch(null, false, appData);
     return true;
 }
Bob.T.Terminal
From what I understand this gets triggered when someone presses the search key (or something else that triggers search). What I need, though, is something that updates the search suggestion whenever a new character is entered/removed into the search field.
znq