I have an EditText but I want only one line. I put lime this
- 1
Please use
android:singleLine="true"
instead of
- 1
- 1
- 1
That single attribute is enough to make your EditText accept only one line of text and disable the enter button.
UPDATE
Don't worry about this comment,
android:singleLine is deprecated it's not a good practice using it
This attributed is officially supported and is not deprecated in any possible way. And it is also guaranteed that this will work in all devices and on all Android versions.