Android的检测完成关键preSS的屏幕键盘

Android的检测完成关键preSS的屏幕键盘

问题描述:

时有可能发现,当屏幕键盘的完成关键是pressed?

Is it possible to detect when the Done key of onScreen keyboard was pressed ?

是的,这是可能的:

editText = (EditText) findViewById(R.id.edit_text);

editText.setOnEditorActionListener(new OnEditorActionListener() {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            // do your stuff here
        }
        return false;
    }
});