Jase Whatson Jase Whatson - 1 month ago 9
Android Question

Android EditText keyboard newline not working (only on input view)

In the affirmation text field I press the newline button and it puts spaces.
However after I click done the field actually has the correct new lines (second screen capture).

Its not a problem with the device as it works correctly for the compose mail filed in the gmail app. Which is how I would like this to work.

W

enter image description here

<TextView
android:inputType="textMultiLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="@string/edit_affimation"
/>
<EditText
android:id="@+id/affText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp"
android:singleLine="false"
>
</EditText>

Answer

Figured it out

<EditText
    android:inputType="textMultiLine"
    android:id="@+id/affText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text=""
    android:textSize="18sp"
    android:singleLine="false">
</EditText>

Add following attribute:

android:inputType="textMultiLine"
Comments