to top
Android APIs
public final class

SearchableInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.SearchableInfo

Class Overview

Searchability meta-data for an activity. Only applications that search other applications should need to use this class. See Searchable Configuration for more information about declaring searchability meta-data for your application.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<SearchableInfo> CREATOR Support for parcelable and aidl operations.
Public Methods
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.
int getHintId()
Gets the resource id of the hint text.
int getImeOptions()
Gets the input method options specified in the searchable attributes.
int getInputType()
Gets the input type as specified in the searchable attributes.
ComponentName getSearchActivity()
Gets the component name of the searchable activity.
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.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<SearchableInfo> CREATOR

Added in API level 8

Support for parcelable and aidl operations.

Public Methods

public boolean autoUrlDetect ()

Added in API level 8

Checks whether this searchable activity has auto URL detection turned on.

public int describeContents ()

Added in API level 8

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public int getHintId ()

Added in API level 8

Gets the resource id of the hint text. This must be read using the searchable Activity's resources.

Returns
  • A resource id, or 0 if no hint was specified.
See Also

public int getImeOptions ()

Added in API level 8

Gets the input method options specified in the searchable attributes. This will default to IME_ACTION_GO if not specified (which is appropriate for a search box).

Returns
  • the input type

public int getInputType ()

Added in API level 8

Gets the input type as specified in the searchable attributes. This will default to TYPE_CLASS_TEXT if not specified (which is appropriate for free text input).

Returns
  • the input type

public ComponentName getSearchActivity ()

Added in API level 8

Gets the component name of the searchable activity.

Returns
  • A component name, never null.

public int getSettingsDescriptionId ()

Added in API level 8

Gets the resource id of the description string to use for this source in system search settings, or 0 if none has been specified.

public String getSuggestAuthority ()

Added in API level 8

Gets the search suggestion content provider authority.

Returns
  • The search suggestions authority, or null if not set.

public String getSuggestIntentAction ()

Added in API level 8

Gets the optional intent action for use with these suggestions. This is useful if all intents will have the same action (e.g. ACTION_VIEW) This can be overriden in any given suggestion using the column SUGGEST_COLUMN_INTENT_ACTION.

Returns
  • The default intent action, or null if not set.

public String getSuggestIntentData ()

Added in API level 8

Gets the optional intent data for use with these suggestions. This is useful if all intents will have similar data URIs, but you'll likely need to provide a specific ID as well via the column 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 SUGGEST_COLUMN_INTENT_DATA.

Returns
  • The default intent data, or null if not set.

public String getSuggestPackage ()

Added in API level 8

Gets the name of the package where the suggestion provider lives, or null.

public String getSuggestPath ()

Added in API level 8

Gets the content provider path for obtaining search suggestions.

Returns
  • The suggestion path, or null if not set.

public String getSuggestSelection ()

Added in API level 8

Gets the selection for obtaining search suggestions.

public int getSuggestThreshold ()

Added in API level 8

Gets the suggestion threshold.

Returns
  • The suggestion threshold, or 0 if not set.

public int getVoiceLanguageId ()

Added in API level 8

Gets the resource id of the spoken language to recognize in voice search.

Returns
  • A resource id, or 0 if no language was specified.

public int getVoiceLanguageModeId ()

Added in API level 8

Gets the resource id of the voice search language model string.

Returns
  • A resource id, or 0 if no language model was specified.

public int getVoiceMaxResults ()

Added in API level 8

The maximum number of voice recognition results to return.

Returns
  • the max results count, if specified in the searchable activity's metadata, or 0 if not specified.

public int getVoicePromptTextId ()

Added in API level 8

Gets the resource id of the voice prompt text string.

Returns
  • A resource id, or 0 if no voice prompt text was specified.

public boolean getVoiceSearchEnabled ()

Added in API level 8

Checks if the searchable activity wants the voice search button to be shown.

public boolean getVoiceSearchLaunchRecognizer ()

Added in API level 8

Checks if voice search should start in-app search.

public boolean getVoiceSearchLaunchWebSearch ()

Added in API level 8

Checks if voice search should start web search.

public boolean queryAfterZeroResults ()

Added in API level 8

Checks whether this searchable activity should be queried for suggestions if a prefix of the query has returned no results.

public boolean shouldIncludeInGlobalSearch ()

Added in API level 8

Checks whether the searchable should be included in global search.

Returns

public boolean shouldRewriteQueryFromData ()

Added in API level 8

Checks whether the text in the query field should come from the suggestion intent data.

public boolean shouldRewriteQueryFromText ()

Added in API level 8

Checks whether the text in the query field should come from the suggestion title.

public void writeToParcel (Parcel dest, int flags)

Added in API level 8

Flatten this object in to a Parcel.

Parameters
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_WRITE_RETURN_VALUE.