Most visited

Recently visited

Added in API level 11

SearchView.OnSuggestionListener

public static interface SearchView.OnSuggestionListener

android.widget.SearchView.OnSuggestionListener


建议选择事件的回调界面。 这些回调仅在setSearchableInfo(SearchableInfo)指定了setSearchableInfo(SearchableInfo)

Summary

Public methods

abstract boolean onSuggestionClick(int position)

当点击一个建议时调用。

abstract boolean onSuggestionSelect(int position)

当通过导航选择建议时调用。

Public methods

onSuggestionClick

Added in API level 11
boolean onSuggestionClick (int position)

当点击一个建议时调用。

Parameters
position int: the absolute position of the clicked item in the list of suggestions.
Returns
boolean true if the listener handles the event and wants to override the default behavior of launching any intent or submitting a search query specified on that item. Return false otherwise.

onSuggestionSelect

Added in API level 11
boolean onSuggestionSelect (int position)

当通过导航选择建议时调用。

Parameters
position int: the absolute position in the list of suggestions.
Returns
boolean true if the listener handles the event and wants to override the default behavior of possibly rewriting the query based on the selected item, false otherwise.

Hooray!