android监听软键盘enter按键

android监听软键盘enter按键,网上找了几个方案都不好使,自己打印日志,得出下面这个方式

 

        et.setImeOptions(EditorInfo.IME_ACTION_SEND);
        etNum.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
                if ((!T.isFastClick() &&actionId==EditorInfo.IME_ACTION_SEND)) {
                    login();
                    return true;
                }
                return false;
            }
        });

 

你可能感兴趣的:(android,杂)