Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Using EditText for Text Input

Sebastian Dieser
PLUS
Sebastian Dieser
Courses Plus Student 6,485 Points

Enter Key

Hey everybody,

I am running the default keyboard on my galaxy s5.

Everything is working fine but I have a "new line"/"enter" key on my keyboard. When pressed it make the cursor goto the next line. Is there a way to disable this?

1 Answer

Felix Salazar
Felix Salazar
3,879 Points

It depends on the 'type' of Text Field you use. Normally if you want a multiline EditText you could change the android:inputType to text. There are also some others properties like: android:singleLine and android:lines, Try to play with them and see what happens! Hope it helps.