public static interface SearchView.OnSuggestionListener
android.widget.SearchView.OnSuggestionListener |
建议选择事件的回调界面。 这些回调仅在setSearchableInfo(SearchableInfo)
指定了setSearchableInfo(SearchableInfo)
。
Public methods |
|
---|---|
abstract boolean |
onSuggestionClick(int position) 当点击一个建议时调用。 |
abstract boolean |
onSuggestionSelect(int position) 当通过导航选择建议时调用。 |
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. |
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. |