In my application I need only english keyboard. If user changes the language(hindi) in settings page(input & language)keyboard inside my application also changes to hindi language. How to restrict keyboard to English language only?
Asked
Active
Viewed 904 times
0
-
The user can switch to whatever keyboard that the user wants, for whatever reason the user wants. This can include changing the language. You do not get a vote in whether or not the user changes languages or keyboards. – CommonsWare Jun 15 '21 at 10:48
1 Answers
0
@CommonsWare's answer is correct. However, you should probably filter the input anyways. Forcing English keyboard doesn't force user to use only English letters. User can still long press a character or have a non-english hardware keyboard.
You could listen to text change events and reject all characters that are not accepted by your DB at that point.
See question asked previously how to force english keyboard in android EditText

ezaspi
- 684
- 7
- 25