If I set SingleLine=true on an EditText widget, I get a single-line edit control that doesn\'t allow hard returns to be inserted by the user (clicking Enter moves to the nex
editText.setImeOptions(EditorInfo.IME_ACTION_DONE);
//This will treat Enter as Done instead of new line:
editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
And in XML:
android:inputType="textMultiLine"