Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText multiline with "next view button" instead of "new line button"

Goal is to use multiline EditText with android:inputType="textMultiLine" and with "next view button" such as android:inputType="text" (see picture 2).

<EditText
    android:id="@+id/addAffirmationContent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textMultiLine"
    android:maxLength="255"
    android:imeOptions="flagNoExtractUi" />

I tried many combinations with: android:inputType, singleLine, nextFocusDown, nextFocusUp, nextFocusLeft, nextFocusRight, nextFocusForward, imeOptions, lines, but android:inputType="textMultiLine" always forces new line button.

Tested on Nexus 5 Android 7.

Picture 1.: new line button:
new line button

Picture 2.: next view button:
next view button

like image 973
t0m Avatar asked Dec 05 '25 04:12

t0m


1 Answers

I think what you are looking for is the same as in this answer:

In code:

editText.setImeOptions(EditorInfo.IME_ACTION_NEXT);
editText.setRawInputType(InputType.TYPE_CLASS_TEXT);

and in xml:

android:inputType="textMultiLine"
like image 74
MikeL Avatar answered Dec 07 '25 20:12

MikeL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!