android的软键盘的enter键的轮换

android的软键盘的enter键的替换

界面表现就是一个属性的设置:

android:imeOptions

 

有如下值可设置:normal,actionUnspecified,actionNone,actionGo,actionSearch,actionSend,actionNext,actionDone

 

事件捕捉:

editText.setOnEditorActionListener(new TextView.OnEditorActionListener()
                {

                    public boolean onEditorAction(TextView v, int actionId,
                            KeyEvent event)
                    {
                        if (actionId == EditorInfo.IME_ACTION_SEND)
                        {
                            // Do someThing
                        }
                        return false;
                    }
                });