I added a SearchView to the ActionBar of my application and set up SuggestionsProvider using SearchableInfo. Suggestions really work well, except that offers are not displayed when the text of the search query is empty. I found that my offer provider is not being requested for offers, even if searchSuggestThreshold is set to 0.
The closest I came to the decision was to use setOnQueryTextFocusChangeListener, and inFocusChange to exchange the cursor of the SearchView sentence adapter. Thus, I see that the sentence falls out with the correct height, however the text of the sentence is not displayed.
This is how I request a cursor to display sentences for empty text.
Cursor emptySuggestions = getContentResolver().query( Uri.parse("content://my.authority/search_suggest_query/test"), null, null, null, null);
Is there a way to formulate sentences correctly?
Of course, there is always the opportunity to show your own ListPopupWindow when the search query is empty, but I would like to avoid this if there is no easy way to reuse the layout used in SearchView.
source share