标签:gets text ext.get window override tor win 按钮 键盘
android:imeOptions="actionSearch"
EditView.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(actionId ==EditorInfo.IME_ACTION_SEARCH){
// 先隐藏键盘
((InputMethodManager) searchText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
.hideSoftInputFromWindow(
getActivity()
.getCurrentFocus()
.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
//实现自己的搜索逻辑
return true;
}
return false;
}
});
标签:gets text ext.get window override tor win 按钮 键盘
原文地址:https://www.cnblogs.com/xuyj/p/10262403.html