2

I have Two Radio button(Hindi And English). when i click hindi radio then my keyboard language change to Hindi and focus on edittext, same as english. how is possible?

I have use following code

    super.onCreate(savedInstanceState);
    Resources res = RegistartionActivity.this.getResources();
    // Change locale settings in the app.
    DisplayMetrics dm = res.getDisplayMetrics();
    android.content.res.Configuration conf = res.getConfiguration();
    conf.locale = new Locale("ch".toLowerCase());
    res.updateConfiguration(conf, dm);

    setContentView(R.layout.activity_registartion);

help me..... thanks in advance

1 Answers1

0

This isn't really that possible. You can change the users locale using a number of solutions present on stackoverflow already:

Here for example, or here for another.

However, this will only change the locale. The problem you will encounter is that the keyboard is itself an application. Therefore, you cannot change it directly from your app, nor can you guarantee that your user will have the "Hindi" charset or addon or whatever, for they keyboard app that they employ.

Your only real and reliable solution if you wish to accomplish what you need would be to create your own keyboard input. Otherwise, it will be in the user's hands to change their keyboard to English or Hindi.

Either you need to create custom keyboard or you need to change language of system

Like Here or Hindi_Keyboard or this

Community
  • 1
  • 1
King of Masses
  • 18,405
  • 4
  • 60
  • 77