When the user clicks on the EditView
, Android opens the keyboard so that user can write in the EditView
.
The problem is, when the user is done writing, there is no way to hide the keyboard. The user has to press the back button to hide the keyboard.
Is there a way to display a Done
button on the keyboard that will hide the keyboard?
First you need to set the android:imeOptions
attribute equal to actionDone
for your target EditText as seen below. That will change your ‘RETURN’ button in your EditText’s soft keyboard to a ‘DONE’ button.
<EditText
android:id="@+id/edittext_done"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter some text"
android:imeOptions="actionDone"
android:singleLine="true"
/>