Android.App.SearchManager.StartSearch Method
Launch search UI.

Syntax

[Android.Runtime.Register("startSearch", "(Ljava/lang/String;ZLandroid/content/ComponentName;Landroid/os/Bundle;Z)V", "GetStartSearch_Ljava_lang_String_ZLandroid_content_ComponentName_Landroid_os_Bundle_ZHandler")]
public virtual void StartSearch (string initialQuery, bool selectInitialQuery, Android.Content.ComponentName launchActivity, Android.OS.Bundle appSearchData, bool globalSearch)

See Also

Activity.OnSearchRequested
SearchManager.StopSearch

Parameters

initialQuery
A search string can be pre-entered here, but this is typically null or empty.
selectInitialQuery
If true, the intial query will be preselected, which means that any further typing will replace it. This is useful for cases where an entire pre-formed query is being inserted. If false, the selection point will be placed at the end of the inserted query. This is useful when the inserted query is text that the user entered, and the user would expect to be able to keep typing. This parameter is only meaningful if initialQuery is a non-empty string.
launchActivity
The ComponentName of the activity that has launched this search.
appSearchData
An application can insert application-specific context here, in order to improve quality or specificity of its own searches. This data will be returned with SEARCH intent(s). Null if no extra data is required.
globalSearch
If false, this will only launch the search that has been specifically defined by the application (which is usually defined as a local search). If no default search is defined in the current application or activity, global search will be launched. If true, this will always launch a platform-global (e.g. web-based) search instead.

Remarks

Launch search UI.

The search manager will open a search widget in an overlapping window, and the underlying activity may be obscured. The search entry state will remain in effect until one of the following events:

  • The user completes the search. In most cases this will launch a search intent.
  • The user uses the back, home, or other keys to exit the search.
  • The application calls the SearchManager.StopSearch method, which will hide the search window and return focus to the activity from which it was launched.

Most applications will not use this interface to invoke search. The primary method for invoking search is to call Activity.OnSearchRequested or Activity.StartSearch(string, System.Boolean, System.Boolean, System.Boolean).

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1