Android SearchRecentSuggestions - suggestions do not get displayed when typing in SearchView Android SearchRecentSuggestions - suggestions do not get displayed when typing in SearchView android android

Android SearchRecentSuggestions - suggestions do not get displayed when typing in SearchView


I think the problem was, that the declaration of the SearchHistoryProviderin the Manifest.xml was wrong.

android:name=".SearchHistoryProvider"

Writing .$NAME is a shorthand for $DEFAULTPACKAGE.$NAME, so if your $DEFAULTPACKAGE is 'com.myapp'und you write .SearchHistoryProvider as the android:name of your Provider, Android will simply not find it, as it is located incom.mypackage, as the first line of the following code indicates.

package com.mypackage;import android.content.SearchRecentSuggestionsProvider;public class SearchHistoryProvider extends SearchRecentSuggestionsProvider {    public final static String AUTHORITY = SearchHistoryProvider.class.getName();    public final static int MODE = DATABASE_MODE_QUERIES;    public SearchHistoryProvider() {        setupSuggestions(AUTHORITY, MODE);    }}