Reputation: 78
I am trying to implement a SuggestionProvider for my App. I've made it running, but the issue I face is that after clicking on a suggestion - it's value is not replaced in the Query Text above. Basically - clicking on it - does what is expected, but afterwards - the text in the search view remains the same as what was written by the user, and not what was selected from the suggestion.
in my Search Configuration i have android:searchMode="queryRewriteFromText"
, and in my SearchProvider i utilize SearchManager.SUGGEST_COLUMN_QUERY
, and set it to the same value as the value of the Search Suggestion.
Do I need to do something special to get it updated after the click ?
Upvotes: 3
Views: 679
Reputation: 535
Well, now is probably late, but maybe can help someone. Whatever intent you get, you can grab query like this:
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
mSearchView.setQueryText(query, false);
} else if (Intent.ACTION_VIEW.equals(namera.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
mSearchView.setQuery(query, false);
}
Upvotes: 2