Change Keyboard Input Language Programmatically
<p>I am developing an application in which i need to allow the user to change the input keys shown in the default keyboard, upon request or by default, for example, i may prompt the user at the beginning to select the default language and after that, whenever the default keyboard is used, the app always displays the keys of the keyboard the selected language,</p>

<p>I know this is possible, because in default keyboard app, when multiple input methods are selected, then long pressing the spacebar allows to change the input methods at runtime, if this is possible then my requirement is also possible...</p>

<p>I dont want to prompt for default keyboard like following:</p>

<pre><code>InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
imeManager.showInputMethodPicker();
</code></pre>

<p>I dont want to change the locale and restart my activity all the time like:</p>

<pre><code>Resources res = getBaseContext().getResources();
// Change locale settings in the app.
DisplayMetrics dm = res.getDisplayMetrics();
android.content.res.Configuration conf = res.getConfiguration();
conf.locale = new Locale("ru".toLowerCase());
res.updateConfiguration(conf, dm);
Log.i("inside onStart","after ever");   
setContentView(R.layout.activity_main);
</code></pre>

<p>I just want to show the keyboard input in my desired language.</p>