Prevent other language except English in EditText

前端 未结 2 1063
独厮守ぢ
独厮守ぢ 2021-02-05 03:27

My android app has an EditText field where user can give input. But now i want user can\'t give input other (i.e Japanese, chain\'s) than English language.

2条回答
  •  我寻月下人不归
    2021-02-05 03:58

    You can add a TextWatcher that checks what the user is trying to enter (and reject what you don't want).

    You cannot really check the language, though, but I guess you just want to limit the character set (to ASCII or maybe Latin-1).

提交回复
热议问题