Android disable Enter key in soft keyboard
Can anyone tell me how to disable and enable the Enter key in the soft keyboard? just go to your xml and put this attribute in EditText android:singleLine="true" and your enter key will be gone Shankar Agarwal Attach OnEditorActionListener to your text field and return true from its onEditorAction method, when actionId is equal to IME_ACTION_DONE . This will prevent soft keyboard from hiding: EditText txtEdit = (EditText) findViewById(R.id.txtEdit); txtEdit.setOnEditorActionListener(new OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if