I created a normal search dialog, which correctly shows the suggestions when I type, then I tried to switch to a SearchView, but then the suggestions stopped working. The search part still works though.
The CursorAdapter of SearchView is initialized, the suggestAuthority, suggestionIntentAction, SuggestionSelection are all set (and works with search dialog). SearchView.SearchAutoComplete text view get its suggestion adapter set in the SearchView.updateSearchAutoComplete.
My content provider extends SearchRecentSuggestionsProvider, and the provider is created because I reach the ctor, but the query function is never called.
I've tested on both ICS and GB, using ABS 4.2. Am I missing something or doesn't search suggestions work?
onCreateOptionsMenu:
SearchView searchView = new SearchView(getSupportActionBar().getThemedContext());
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
CursorAdapter adapter = searchView.getSuggestionsAdapter(); // Just for a test, it's not null
menu.add("Search")
.setIcon( R.drawable.abs__ic_search)
.setActionView(searchView)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
Searchable.xml
<?xml version="1.0" encoding="utf-8"?>
android:hint="@string/search_hint"
android:label="@string/app_name"
android:searchSuggestAuthority="com.lostpixels.fieldservice.helpfunctions.SearchSuggestionsProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestSelection=" ?"
android:searchSuggestThreshold="0"
android:searchSuggestIntentData="content://com.lostpixels.fieldservice/person">
</searchable>