C
C
cfmm2015-10-09 18:53:58
Android
cfmm, 2015-10-09 18:53:58

Why Wirth is not hiding. keyboard after pressing Enter in EditText?

The layout has this EditText:

<EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/nameFind"
            android:maxWidth="250dp"
            android:layout_marginRight="10dp"
            android:layout_gravity="right"
            android:textColor="#FFFFFF"
            android:ems="12"
            android:textStyle="italic"
            android:singleLine="true"
            android:inputType="textAutoComplete"
            android:maxLength="20"
            android:imeOptions="actionSearch"/>

After entering the text and clicking on Wirth. Enter button keyboard does not disappear from the screen, even though the focus of the EditText disappears.
How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2015-10-09
@cfmm

put a focussener in the text field and enter in it:

InputMethodManager inputMethodManager = (InputMethodManager)
                context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question