Home Ask Login Register

Developers Planet

Your answer is one click away!

user934820 February 2016

how to check if edittext is single line android

I am making a custom android keyboard. I want to make it sure that when user press enter key proper EditorAction took place. Therefore I want to know is there any way to check if edittext is single line or not? Or is there any way to check min and max lines of editext?


beef February 2016

In your onStartInput(EditorInfo info) and onStartInputView(EditorInfo info) callbacks EditorInfo is passed in.

To check if it's a multiline you can do:

if (0 != (info.inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE)) {
   //This is multiline text field


Post Status

Asked in February 2016
Viewed 1,741 times
Voted 7
Answered 1 times


Leave an answer

Quote of the day: live life