edittext.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { /*判斷是不是「GO」鍵*/ if(actionId == EditorInfo.IME_ACTION_GO){ edittext.setText("success"); return true; } return false; } });