I’m surprised that why EditText is multi-line in android i-e when we hit return key it goes to new line, and I also want to ask that can we add an event listener on pressing return key while working in EditText and not to go on new line. please help!!!
Share
You can use
android:SingleLineTo detect an Enter key-press
edittext.setOnKeyListener(new OnKeyListener() { ... });can be used. (Reference)Also, see this answer for more.