1

how we can specify input language for specific EditText(not for the whole app) any help will be appreciated ..for example, for EditText1, I want to open the English keyboard and for EditText2 want to open some other language any help...

Manoj Perumarath
  • 9,337
  • 8
  • 56
  • 77
ASIF
  • 25
  • 6

2 Answers2

0

As far as I know you can't change the user's keyboard, it has to be changed by the user itself.

If you want to control if the user is introducing specific characters (f.e. chinese characters in an EditText), I would use a TextWatcher and apply a Regex pattern to evaluate the introduced String.

Jaime Suarez
  • 660
  • 4
  • 11
  • Suarez Actually i want to show some other language alphabets to user instead of English let say Urdu or Arabic and want input from those language. – ASIF May 31 '19 at 03:45
  • I found something but it looks a workaround (https://stackoverflow.com/questions/36261166/change-keyboard-input-language-programmatically). I think the user is the one who should switch the keyboard and in your side you should control which characters are allowed (you could put a hint with the required characters to be clearer). – Jaime Suarez May 31 '19 at 03:56
0

You can't change the user's keyboard. Only system apps can do that.

One possible workaround is to create your own custom keyboard views and switch programmatically.

For this, you have to create separate layouts and classes(extends KeyboardView) for each language keyboard