editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
performSearch();
return true;
}
return false;
}
});
本文介绍如何在EditText中设置IME_ACTION_SEARCH触发搜索功能,通过OnEditorActionListener实现搜索操作。
4万+

被折叠的 条评论
为什么被折叠?



