There are several fields to enter. In one of the fields you need to enter data only in English.

Is it possible to do something like that for this field, the input language itself has changed to English?

    1 answer 1

    It is possible to do this as follows: it is possible to limit the input for a user to a set of specific characters, done using the digits property in xml `ke.

    Example:

    <EditText android:id="@+id/nameText" android:layout_width="177dp" android:layout_height="wrap_content" android:inputType="text" android:digits="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ" /> 

    a source

    in the same place, by the way, there is an idea to use TextWatcher , with the help of which to erase non-English characters in EdtiText

    • one
      In a complement way without xml InputType.setInputType (InputType.TYPE_CLASS_TEXT); editText.setKeyListener (DigitsKeyListener.getInstance ("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ.")); - linya
    • Thank. This is one of the suitable options. I thought about this. I just wanted the keyboard language to change by itself - user11344