Most visited

Recently visited

SearchView.OnSuggestionListener

public static interface SearchView.OnSuggestionListener

android.support.v7.widget.SearchView.OnSuggestionListener


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

Summary

Public methods

abstract boolean onSuggestionClick(int position)

当点击一个建议时调用。

abstract boolean onSuggestionSelect(int position)

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

Public methods

onSuggestionClick

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

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!