I have a working search widget and want to add search history suggestions. I followed the Android tutorial (http://developer.android.com/guide/topics/search/adding-recent-query-
I think the problem was, that the declaration of the SearchHistoryProvider in 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 in com.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);
}
}