java.lang.Object | ||
↳ | android.content.ContentProvider | |
↳ | android.content.SearchRecentSuggestionsProvider |
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.
<!-- Content provider for search suggestions --> <provider android:name="YourSuggestionProviderClass" android:authorities="your.suggestion.authority" />
android:searchSuggestAuthority="your.suggestion.authority" android:searchSuggestSelection=" ? "
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DATABASE_MODE_2LINES | This mode bit configures the database to include a 2nd annotation line with each entry. | |||||||||
int | DATABASE_MODE_QUERIES | This mode bit configures the database to record recent queries. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is provided for use by the ContentResolver.
| |||||||||||
This method is provided for use by the ContentResolver.
| |||||||||||
This method is provided for use by the ContentResolver.
| |||||||||||
This method is provided for use by the ContentResolver.
| |||||||||||
This method is provided for use by the ContentResolver.
| |||||||||||
This method is provided for use by the ContentResolver.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
In order to use this class, you must extend it, and call this setup function from your
constructor.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class android.content.ContentProvider
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface android.content.ComponentCallbacks
|
This mode bit configures the database to include a 2nd annotation line with each entry. optional
This mode bit configures the database to record recent queries. required
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
uri | The full URI to query, including a row ID (if a specific record is requested). |
---|---|
selection | An optional restriction to apply to rows when deleting. |
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
uri | the URI to query. |
---|
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
uri | The content:// URI of the insertion request. |
---|---|
values | A set of column_name/value pairs to add to the database. |
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
uri | The URI to query. This will be the full URI sent by the client; if the client is requesting a specific record, the URI will end in a record number that the implementation should parse and add to a WHERE or HAVING clause, specifying that _id value. |
---|---|
projection | The list of columns to put into the cursor. If null all columns are included. |
selection | A selection criteria to apply when filtering rows. If null then all rows are included. |
sortOrder | How the rows in the cursor should be sorted. If null then the provider is free to define the sort order. |
This method is provided for use by the ContentResolver. Do not override, or directly call from your own code.
uri | The URI to query. This can potentially have a record ID if this is an update request for a specific record. |
---|---|
values | A Bundle mapping from column names to new column values (NULL is a valid value). |
selection | An optional filter to match rows to update. |
In order to use this class, you must extend it, and call this setup function from your constructor. In your application or activities, you must provide the same values when you create the SearchRecentSuggestions helper.
authority | This must match the authority that you've declared in your manifest. |
---|---|
mode | You can use mode flags here to determine certain functional aspects of your database. Note, this value should not change from run to run, because when it does change, your suggestions database may be wiped. |