IT. Expert System.

Android Reference

SearchManager


android.app

Class SearchManager

    • Field Detail

      • MENU_KEY

        public static final char MENU_KEY
        This is a shortcut definition for the default menu key to use for invoking search. See Menu.Item.setAlphabeticShortcut() for more information.
        See Also:
        Constant Field Values
      • MENU_KEYCODE

        public static final int MENU_KEYCODE
        This is a shortcut definition for the default menu key to use for invoking search. See Menu.Item.setAlphabeticShortcut() for more information.
        See Also:
        Constant Field Values
      • ACTION_KEY

        public static final String ACTION_KEY
        Intent extra data key: Use this key with Intent.ACTION_SEARCH and content.Intent.getIntExtra() to obtain the keycode that the user used to trigger this query. It will be zero if the user simply pressed the "GO" button on the search UI. This is primarily used in conjunction with the keycode attribute in the actionkey element of your searchable.xml configuration file.
        See Also:
        Constant Field Values
      • EXTRA_SELECT_QUERY

        public static final String EXTRA_SELECT_QUERY
        Boolean extra data key for INTENT_ACTION_GLOBAL_SEARCH intents. If true, the initial query should be selected when the global search activity is started, so that the user can easily replace it with another query.
        See Also:
        Constant Field Values
      • CURSOR_EXTRA_KEY_IN_PROGRESS

        public static final String CURSOR_EXTRA_KEY_IN_PROGRESS
        Boolean extra data key for a suggestion provider to return in Cursor.getExtras() to indicate that the search is not complete yet. This can be used by the search UI to indicate that a search is in progress. The suggestion provider can return partial results this way and send a change notification on the cursor when more results are available.
        See Also:
        Constant Field Values
      • ACTION_MSG

        public static final String ACTION_MSG
        Intent extra data key: Use this key with Intent.ACTION_SEARCH and content.Intent.getStringExtra() to obtain the action message that was defined for a particular search action key and/or suggestion. It will be null if the search was launched by typing "enter", touched the the "GO" button, or other means not involving any action key.
        See Also:
        Constant Field Values
      • FLAG_QUERY_REFINEMENT

        public static final int FLAG_QUERY_REFINEMENT
        Flag to specify that the entry can be used for query refinement, i.e., the query text in the search field can be replaced with the text in this entry, when a query refinement icon is clicked. The suggestion list should show such a clickable icon beside the entry.

        Use this flag as a bit-field for SUGGEST_COLUMN_FLAGS.

        See Also:
        Constant Field Values
      • SUGGEST_URI_PATH_QUERY

        public static final String SUGGEST_URI_PATH_QUERY
        Uri path for queried suggestions data. This is the path that the search manager will use when querying your content provider for suggestions data based on user input (e.g. looking for partial matches). Typically you'll use this with a URI matcher.
        See Also:
        Constant Field Values
      • SUGGEST_MIME_TYPE

        public static final String SUGGEST_MIME_TYPE
        MIME type for suggestions data. You'll use this in your suggestions content provider in the getType() function.
        See Also:
        Constant Field Values
      • SUGGEST_URI_PATH_SHORTCUT

        public static final String SUGGEST_URI_PATH_SHORTCUT
        Uri path for shortcut validation. This is the path that the search manager will use when querying your content provider to refresh a shortcutted suggestion result and to check if it is still valid. When asked, a source may return an up to date result, or no result. No result indicates the shortcut refers to a no longer valid sugggestion.
        See Also:
        SUGGEST_COLUMN_SHORTCUT_ID, Constant Field Values
      • SHORTCUT_MIME_TYPE

        public static final String SHORTCUT_MIME_TYPE
        MIME type for shortcut validation. You'll use this in your suggestions content provider in the getType() function.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_FORMAT

        public static final String SUGGEST_COLUMN_FORMAT
        Column name for suggestions cursor. Unused - can be null or column can be omitted.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_TEXT_1

        public static final String SUGGEST_COLUMN_TEXT_1
        Column name for suggestions cursor. Required. This is the primary line of text that will be presented to the user as the suggestion.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_TEXT_2

        public static final String SUGGEST_COLUMN_TEXT_2
        Column name for suggestions cursor. Optional. If your cursor includes this column, then all suggestions will be provided in a two-line format. The second line of text is in a much smaller appearance.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_TEXT_2_URL

        public static final String SUGGEST_COLUMN_TEXT_2_URL
        Column name for suggestions cursor. Optional. This is a URL that will be shown as the second line of text instead of SUGGEST_COLUMN_TEXT_2. This is a separate column so that the search UI knows to display the text as a URL, e.g. by using a different color. If this column is absent, or has the value null, SUGGEST_COLUMN_TEXT_2 will be used instead.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_INTENT_ACTION

        public static final String SUGGEST_COLUMN_INTENT_ACTION
        Column name for suggestions cursor. Optional. If this column exists and this element exists at the given row, this is the action that will be used when forming the suggestion's intent. If the element is not provided, the action will be taken from the android:searchSuggestIntentAction field in your XML metadata. At least one of these must be present for the suggestion to generate an intent. Note: If your action is the same for all suggestions, it is more efficient to specify it using XML metadata and omit it from the cursor.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_INTENT_DATA

        public static final String SUGGEST_COLUMN_INTENT_DATA
        Column name for suggestions cursor. Optional. If this column exists and this element exists at the given row, this is the data that will be used when forming the suggestion's intent. If the element is not provided, the data will be taken from the android:searchSuggestIntentData field in your XML metadata. If neither source is provided, the Intent's data field will be null. Note: If your data is the same for all suggestions, or can be described using a constant part and a specific ID, it is more efficient to specify it using XML metadata and omit it from the cursor.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_INTENT_EXTRA_DATA

        public static final String SUGGEST_COLUMN_INTENT_EXTRA_DATA
        Column name for suggestions cursor. Optional. If this column exists and this element exists at the given row, this is the data that will be used when forming the suggestion's intent. If not provided, the Intent's extra data field will be null. This column allows suggestions to provide additional arbitrary data which will be included as an extra under the key EXTRA_DATA_KEY.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_INTENT_DATA_ID

        public static final String SUGGEST_COLUMN_INTENT_DATA_ID
        Column name for suggestions cursor. Optional. If this column exists and this element exists at the given row, then "/" and this value will be appended to the data field in the Intent. This should only be used if the data field has already been set to an appropriate base string.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_QUERY

        public static final String SUGGEST_COLUMN_QUERY
        Column name for suggestions cursor. Required if action is ACTION_SEARCH, optional otherwise. If this column exists and this element exists at the given row, this is the data that will be used when forming the suggestion's query.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_SHORTCUT_ID

        public static final String SUGGEST_COLUMN_SHORTCUT_ID
        Column name for suggestions cursor. Optional. This column is used to indicate whether a search suggestion should be stored as a shortcut, and whether it should be refreshed. If missing, the result will be stored as a shortcut and never validated. If set to SUGGEST_NEVER_MAKE_SHORTCUT, the result will not be stored as a shortcut. Otherwise, the shortcut id will be used to check back for an up to date suggestion using SUGGEST_URI_PATH_SHORTCUT.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING

        public static final String SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING
        Column name for suggestions cursor. Optional. This column is used to specify that a spinner should be shown in lieu of an icon2 while the shortcut of this suggestion is being refreshed.
        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_FLAGS

        public static final String SUGGEST_COLUMN_FLAGS
        Column name for suggestions cursor. Optional. This column is used to specify additional flags per item. Multiple flags can be specified.

        Must be one of FLAG_QUERY_REFINEMENT or 0 to indicate no flags.

        See Also:
        Constant Field Values
      • SUGGEST_COLUMN_LAST_ACCESS_HINT

        public static final String SUGGEST_COLUMN_LAST_ACCESS_HINT
        Column name for suggestions cursor. Optional. This column may be used to specify the time in System.currentTImeMillis() (wall time in UTC) when an item was last accessed within the results-providing application. If set, this may be used to show more-recently-used items first.
        See Also:
        Constant Field Values
      • SUGGEST_PARAMETER_LIMIT

        public static final String SUGGEST_PARAMETER_LIMIT
        Query parameter added to suggestion queries to limit the number of suggestions returned. This limit is only advisory and suggestion providers may chose to ignore it.
        See Also:
        Constant Field Values
      • INTENT_ACTION_SEARCH_SETTINGS

        public static final String INTENT_ACTION_SEARCH_SETTINGS
        Intent action for starting the global search settings activity. The global search provider should handle this intent.
        See Also:
        Constant Field Values
      • INTENT_ACTION_WEB_SEARCH_SETTINGS

        public static final String INTENT_ACTION_WEB_SEARCH_SETTINGS
        Intent action for starting a web search provider's settings activity. Web search providers should handle this intent if they have provider-specific settings to implement.
        See Also:
        Constant Field Values
      • INTENT_ACTION_SEARCHABLES_CHANGED

        public static final String INTENT_ACTION_SEARCHABLES_CHANGED
        Intent action broadcasted to inform that the searchables list or default have changed. Components should handle this intent if they cache any searchable data and wish to stay up to date on changes.
        See Also:
        Constant Field Values
      • INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED

        public static final String INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED
        Intent action to be broadcast to inform that the global search provider has changed.
        See Also:
        Constant Field Values
      • INTENT_ACTION_SEARCH_SETTINGS_CHANGED

        public static final String INTENT_ACTION_SEARCH_SETTINGS_CHANGED
        Intent action broadcasted to inform that the search settings have changed in some way. Either searchables have been enabled or disabled, or a different web search provider has been chosen.
        See Also:
        Constant Field Values
      • CONTEXT_IS_VOICE

        public static final String CONTEXT_IS_VOICE
        This means that context is voice, and therefore the SearchDialog should continue showing the microphone until the user indicates that he/she does not want to re-speak (e.g. by typing).
        See Also:
        Constant Field Values
      • DISABLE_VOICE_SEARCH

        public static final String DISABLE_VOICE_SEARCH
        This means that the voice icon should not be shown at all, because the current search engine does not support voice search.
        See Also:
        Constant Field Values
    • Method Detail

      • startSearch

        public void startSearch(String initialQuery,
                       boolean selectInitialQuery,
                       ComponentName launchActivity,
                       Bundle appSearchData,
                       boolean globalSearch)
        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 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().

        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.
        See Also:
        Activity.onSearchRequested(), stopSearch()
      • getGlobalSearchActivities

        public List<ResolveInfo> getGlobalSearchActivities()
        Returns a list of installed apps that handle the global search intent.
      • getGlobalSearchActivity

        public ComponentName getGlobalSearchActivity()
        Gets the name of the global search activity.
      • getWebSearchActivity

        public ComponentName getWebSearchActivity()
        Gets the name of the web search activity.
        Returns:
        The name of the default activity for web searches. This activity can be used to get web search suggestions. Returns null if there is no default web search activity.
      • isVisible

        public boolean isVisible()
        Determine if the Search UI is currently displayed. This is provided primarily for application test purposes.
        Returns:
        Returns true if the search UI is currently displayed.
      • getSearchableInfo

        public SearchableInfo getSearchableInfo(ComponentName componentName)
        Gets information about a searchable activity.
        Parameters:
        componentName - The activity to get searchable information for.
        Returns:
        Searchable information, or null if the activity does not exist, or is not searchable.
      • getSuggestions

        public Cursor getSuggestions(SearchableInfo searchable,
                            String query)
        Gets a cursor with search suggestions.
        Parameters:
        searchable - Information about how to get the suggestions.
        query - The search text entered (so far).
        Returns:
        a cursor with suggestions, or null the suggestion query failed.
      • getSuggestions

        public Cursor getSuggestions(SearchableInfo searchable,
                            String query,
                            int limit)
        Gets a cursor with search suggestions.
        Parameters:
        searchable - Information about how to get the suggestions.
        query - The search text entered (so far).
        limit - The query limit to pass to the suggestion provider. This is advisory, the returned cursor may contain more rows. Pass -1 for no limit.
        Returns:
        a cursor with suggestions, or null the suggestion query failed.
      • getSearchablesInGlobalSearch

        public List<SearchableInfo> getSearchablesInGlobalSearch()
        Returns a list of the searchable activities that can be included in global search.
        Returns:
        a list containing searchable information for all searchable activities that have the android:includeInGlobalSearch attribute set in their searchable meta-data.
      • getAssistIntent

        public Intent getAssistIntent(Context context)
        Gets an intent for launching installed assistant activity, or null if not available.
        Returns:
        The assist intent.
      • getAssistIntent

        public Intent getAssistIntent(Context context,
                             int userHandle)
        Gets an intent for launching installed assistant activity, or null if not available.
        Returns:
        The assist intent.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1641 / 96487440. Delta: 0.04192 с