Most visited

Recently visited

SearchView.OnQueryTextListener

public static interface SearchView.OnQueryTextListener

android.support.v7.widget.SearchView.OnQueryTextListener


对查询文本进行更改的回调。

摘要(Summary)

公共方法(Public methods)

abstract boolean onQueryTextChange(String newText)

当查询文本被用户更改时调用。

abstract boolean onQueryTextSubmit(String query)

当用户提交查询时调用。

公共方法(Public methods)

onQueryTextChange

boolean onQueryTextChange (String newText)

当查询文本被用户更改时调用。

参数(Parameters)
newText String: the new content of the query text field.
返回(Returns)
boolean false if the SearchView should perform the default action of showing any suggestions if available, true if the action was handled by the listener.

onQueryTextSubmit

boolean onQueryTextSubmit (String query)

当用户提交查询时调用。 这可能是由于按键盘上的按键或按下提交按钮。 侦听器可以通过返回true来覆盖标准行为,以表明它已处理提交请求。 否则,返回false让SearchView通过启动任何关联的意图来处理提交。

参数(Parameters)
query String: the query text that is to be submitted
返回(Returns)
boolean true if the query has been handled by the listener, false to let the SearchView perform the default action.

Hooray!