I'm making an android application and I have an EditText element where, once you press enter in that field, text elsewhere on the same page is updated, though you cannot immediately see it because the keyboard is in the way. In short, is there a way to have the keyboard go away (i.e. have the text editor de-select itself when enter is pressed)?
You just have to set your EditText as singleLine and enable the IMEAction Done, like this:
<EditText
android:id="@+id/myEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:imeActionLabel="Done"
android:imeOptions="actionDone"
android:textColor="@android:color/black"
android:textSize="16sp" />
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