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.
<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>
ADD this to your EditText xml code This will automatically moves your text to next line while entering data. this doesn't add \n chars to the string. just breaks the line in the EditText view, which isn't what the OP is asking for.
To get the input type use getInputType() . int inputTypeValue = editText. getInputType(); The InputType values are defined (in hexadecimal) in the documentation.
To get the number pad, and tap the special character key in the lower left corner of the keyboard. Then, tap the key just to the left of the spacebar with the numbers 1-4 in a little square.
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With