views:

113

answers:

1

i can implement the QSB on my app using onSearchRequested() method.i have 4 column in my table. when i was type in the QSB. it will give some suggestions on the Suggestion window. how to do that? searchable dictionary example shows the dictionary provider class to retrive the suggestions. but on that no data inserted. then how they getting the suggestions. can you explain me what are the steps we have to follow or tutorials, sample codes are most thankful.

+1  A: 

In the Searchable Dictionary example, the suggestions are created by the getSuggestions() method in DictionaryProvider. As you type in the search box, the search framework will query the content provider (after each keystroke, I believe) and display the results returned by the cursor.

Instead of going with the full-blown content provider, you could also choose to implement SearchRecentSuggestionsProvider. However, with this method, your search suggestions generated by a particular search are only shown on subsequent searches. So, it's not as full-featured, but less work to implement.

Here's an overview on search, and more detailed information in SearchManager.

Erich Douglass