I am working in app that have an option to select language. there are two radio button . one for Spanish and other is English. when user select Spanish ,I should change the keyboard in spanish. How can i do that? Please reply me.
Asked
Active
Viewed 2,224 times
3
-
It's not possible to do what you want. The only thing you can do if you want a different keyboard for spanish/english, is to create your own virtual keyboard which requieres some work. – Carnal Aug 06 '13 at 12:43
-
Thanks Carnal, Can you please help me how to make virtual keyboard? – eva Aug 06 '13 at 16:34
2 Answers
4
Someone may correct me but I'm fairly certain there is no option to do that at runtime. The keyboard itself is an application and therefore to change the input language the user has to do that themselves in the settings of whatever keyboard they are using. You can not change it from your app.

D.Bish
- 208
- 1
- 6
-
-
I've just searched and as I suspected this has been asked before. [Here](http://stackoverflow.com/questions/12303593/change-keyboard-input-language). – D.Bish Aug 06 '13 at 13:01
0
Yes in Android you can do almost everything as long as the user accepts upon installation to give control of system settings to your application.
Basically you get the current settings and edit the value contained for language, as below:
Resources res = context.getResources();
// Change locale settings in the app.
DisplayMetrics dm = res.getDisplayMetrics();
android.content.res.Configuration conf = res.getConfiguration();
conf.locale = new Locale(language_code.toLowerCase());
res.updateConfiguration(conf, dm);
Hope it helps

dendini
- 3,842
- 9
- 37
- 74
-
thanks dendini. i have already used it . it only work for changing the string of application . and i need to chage keyboard language when user click on edit text. – eva Aug 06 '13 at 12:37
-
you should indicate in the question what you already tried. I cannot get what you mean by "string of application", anyway under system setting you can change system language and even locale. For a full list see http://developer.android.com/reference/android/provider/Settings.System.html – dendini Aug 06 '13 at 12:39