jay
jay

Reputation: 292

Android Keyboard Language issue

I want to change the keyboard language programatically when user selects EditText field.

i.e.: When user clicks on EditText, by default English language keyboard pops up. But I want the Arabic keyboard to open by default...

Upvotes: 2

Views: 1462

Answers (2)

Sathish
Sathish

Reputation: 4713

It's not possible to change the keyboard settings for the user programmatically. The only thing you can do is advise the user to change it and help it to do so. For instance, this will show a dialog for them to change keyboard:

private void showInputMethodPicker() {
    InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); 
    if (imeManager != null) {
        imeManager.showInputMethodPicker();
    } else {
        Toast.makeText(this, R.string.not_possible_im_picker, Toast.LENGTH_LONG).show();
    }
}

Upvotes: 3

Related Questions