This superclass can be used to create a simple search suggestions provider for your application.
See Also:
SearchRecentSuggestionsProvider Members
Syntax
[Android.Runtime.Register("android/content/SearchRecentSuggestionsProvider", DoNotGenerateAcw=true)]
public class
SearchRecentSuggestionsProvider :
ContentProviderRemarks
This superclass can be used to create a simple search suggestions provider for your application.
It creates suggestions (as the user types) based on recent queries and/or recent views.
In order to use this class, you must do the following.
- Implement and test query search, as described in Android.App.SearchManager. (This
provider will send any suggested queries via the standard
Intent.ActionSearch Intent, which you'll already
support once you have implemented and tested basic searchability.)
- Create a Content Provider within your application by extending
Android.Content.SearchRecentSuggestionsProvider. The class you create will be
very simple - typically, it will have only a constructor. But the constructor has a very
important responsibility: When it calls SearchRecentSuggestionsProvider.SetupSuggestions(string, Android.Content.DatabaseMode), it
configures the provider to match the requirements of your searchable activity.
- Create a manifest entry describing your provider. Typically this would be as simple
as adding the following lines:
xml Example
<!-- Content provider for search suggestions -->
<provider android:name="YourSuggestionProviderClass"
android:authorities="your.suggestion.authority" />
- Please note that you do not instantiate this content provider directly from within
your code. This is done automatically by the system Content Resolver, when the search dialog
looks for suggestions.
- In order for the Content Resolver to do this, you must update your searchable activity's
XML configuration file with information about your content provider. The following additions
are usually sufficient:
java Example
android:searchSuggestAuthority="your.suggestion.authority"
android:searchSuggestSelection=" ? "
- In your searchable activities, capture any user-generated queries and record them
for future searches by calling Android.Provider.SearchRecentSuggestions.SaveRecentQuery(string, System.String).
Developer Guides
For information about using search suggestions in your application, read the
Search developer guide.
See Also
[Android Documentation]
Requirements
Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1