public final class SearchableInfo extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
SearchableInfo.ActionKeyInfo
Information about an action key in searchability meta-data.
|
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<SearchableInfo> |
CREATOR
Support for parcelable and aidl operations.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
boolean |
autoUrlDetect()
Checks whether this searchable activity has auto URL detection turned on.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
SearchableInfo.ActionKeyInfo |
findActionKey(int keyCode)
If any action keys were defined for this searchable activity, look up and return.
|
Context |
getActivityContext(Context context)
Get the context for the searchable activity.
|
static SearchableInfo |
getActivityMetaData(Context context,
ActivityInfo activityInfo,
int userId)
Gets search information for the given activity.
|
int |
getHintId()
Gets the resource id of the hint text.
|
int |
getIconId()
Gets the icon id specified by the Searchable_icon meta-data entry.
|
int |
getImeOptions()
Gets the input method options specified in the searchable attributes.
|
int |
getInputType()
Gets the input type as specified in the searchable attributes.
|
int |
getLabelId()
Gets the "label" (user-visible name) of this searchable context.
|
Context |
getProviderContext(Context context,
Context activityContext)
Get the context for the suggestions provider.
|
ComponentName |
getSearchActivity()
Gets the component name of the searchable activity.
|
int |
getSearchButtonText()
Gets the resource id of replacement text for the "Search" button.
|
int |
getSettingsDescriptionId()
Gets the resource id of the description string to use for this source in system search
settings, or
0 if none has been specified. |
String |
getSuggestAuthority()
Gets the search suggestion content provider authority.
|
String |
getSuggestIntentAction()
Gets the optional intent action for use with these suggestions.
|
String |
getSuggestIntentData()
Gets the optional intent data for use with these suggestions.
|
String |
getSuggestPackage()
Gets the name of the package where the suggestion provider lives,
or
null . |
String |
getSuggestPath()
Gets the content provider path for obtaining search suggestions.
|
String |
getSuggestSelection()
Gets the selection for obtaining search suggestions.
|
int |
getSuggestThreshold()
Gets the suggestion threshold.
|
int |
getVoiceLanguageId()
Gets the resource id of the spoken language to recognize in voice search.
|
int |
getVoiceLanguageModeId()
Gets the resource id of the voice search language model string.
|
int |
getVoiceMaxResults()
The maximum number of voice recognition results to return.
|
int |
getVoicePromptTextId()
Gets the resource id of the voice prompt text string.
|
boolean |
getVoiceSearchEnabled()
Checks if the searchable activity wants the voice search button to be shown.
|
boolean |
getVoiceSearchLaunchRecognizer()
Checks if voice search should start in-app search.
|
boolean |
getVoiceSearchLaunchWebSearch()
Checks if voice search should start web search.
|
boolean |
queryAfterZeroResults()
Checks whether this searchable activity should be queried for suggestions if a prefix
of the query has returned no results.
|
boolean |
shouldIncludeInGlobalSearch()
Checks whether the searchable should be included in global search.
|
boolean |
shouldRewriteQueryFromData()
Checks whether the text in the query field should come from the suggestion intent data.
|
boolean |
shouldRewriteQueryFromText()
Checks whether the text in the query field should come from the suggestion title.
|
boolean |
useBadgeIcon()
Checks whether the badge should be an icon.
|
boolean |
useBadgeLabel()
Checks whether the badge should be a text label.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final Parcelable.Creator<SearchableInfo> CREATOR
public String getSuggestAuthority()
null
if not set.android.R.styleable#Searchable_searchSuggestAuthority
public String getSuggestPackage()
null
.public ComponentName getSearchActivity()
null
.public boolean useBadgeLabel()
android.R.styleable#Searchable_searchMode
public boolean useBadgeIcon()
android.R.styleable#Searchable_searchMode
public boolean shouldRewriteQueryFromData()
android.R.styleable#Searchable_searchMode
public boolean shouldRewriteQueryFromText()
android.R.styleable#Searchable_searchMode
public int getSettingsDescriptionId()
0
if none has been specified.android.R.styleable#Searchable_searchSettingsDescription
public String getSuggestPath()
null
if not set.android.R.styleable#Searchable_searchSuggestPath
public String getSuggestSelection()
android.R.styleable#Searchable_searchSuggestSelection
public String getSuggestIntentAction()
Intent.ACTION_VIEW
)
This can be overriden in any given suggestion using the column
SearchManager.SUGGEST_COLUMN_INTENT_ACTION
.null
if not set.android.R.styleable#Searchable_searchSuggestIntentAction
public String getSuggestIntentData()
SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID
, which will be appended to the
intent data URI.
This can be overriden in any given suggestion using the column
SearchManager.SUGGEST_COLUMN_INTENT_DATA
.null
if not set.android.R.styleable#Searchable_searchSuggestIntentData
public int getSuggestThreshold()
0
if not set.android.R.styleable#Searchable_searchSuggestThreshold
public Context getActivityContext(Context context)
context
- You need to supply a context to start withpublic Context getProviderContext(Context context, Context activityContext)
context
- You need to supply a context to start withactivityContext
- If we can determine that the provider and the activity are the
same, we'll just return this one.public SearchableInfo.ActionKeyInfo findActionKey(int keyCode)
keyCode
- The key that was pressednull
if none defined.public static SearchableInfo getActivityMetaData(Context context, ActivityInfo activityInfo, int userId)
context
- Context to use for reading activity resources.activityInfo
- Activity to get search information from.null
if
the activity has no or invalid searchability meta-data.public int getLabelId()
0
if no label was specified.android.R.styleable#Searchable_label
public int getHintId()
0
if no hint was specified.android.R.styleable#Searchable_hint
public int getIconId()
0
if no icon was specified.android.R.styleable#Searchable_icon
public boolean getVoiceSearchEnabled()
android.R.styleable#Searchable_voiceSearchMode
public boolean getVoiceSearchLaunchWebSearch()
android.R.styleable#Searchable_voiceSearchMode
public boolean getVoiceSearchLaunchRecognizer()
android.R.styleable#Searchable_voiceSearchMode
public int getVoiceLanguageModeId()
0
if no language model was specified.android.R.styleable#Searchable_voiceLanguageModel
public int getVoicePromptTextId()
0
if no voice prompt text was specified.android.R.styleable#Searchable_voicePromptText
public int getVoiceLanguageId()
0
if no language was specified.android.R.styleable#Searchable_voiceLanguage
public int getVoiceMaxResults()
0
if not specified.android.R.styleable#Searchable_voiceMaxResults
public int getSearchButtonText()
0
if no replacement text was specified.android.R.styleable#Searchable_searchButtonText
public int getInputType()
InputType.TYPE_CLASS_TEXT
if not specified (which is appropriate
for free text input).android.R.styleable#Searchable_inputType
public int getImeOptions()
EditorInfo.IME_ACTION_GO
if not specified (which is
appropriate for a search box).android.R.styleable#Searchable_imeOptions
public boolean shouldIncludeInGlobalSearch()
android.R.styleable#Searchable_includeInGlobalSearch
attribute, or false
if the attribute is not set.android.R.styleable#Searchable_includeInGlobalSearch
public boolean queryAfterZeroResults()
android.R.styleable#Searchable_queryAfterZeroResults
public boolean autoUrlDetect()
android.R.styleable#Searchable_autoUrlDetect
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.