1

Right now it's showing English when click on the edit text. How can I change the keyboard to Arabic? I tried installing Arabic keyboard from Google Play, but it is not working in my app.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Abhi
  • 101
  • 1
  • 4
  • 11
  • 1
    As far as I know, you can't. See also: http://stackoverflow.com/questions/6901097/change-input-method-of-android-device-programatically-android – Andrew T. Jun 19 '14 at 10:22
  • Is there any way to create a custom keyboard? – Abhi Jun 19 '14 at 10:56

1 Answers1

3

You cannot set a keyboard for an EditText. The keyboard (or IME) can only be set manually by the user. All you can do is open the dialog from where the user can choose the keyboard. Even for that, the keyboard needs to be enabled in the Language and Input settings

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();
        }
    }
Basant Singh
  • 5,736
  • 2
  • 28
  • 49
  • is there any way to create a custom keyboard in Arabic? – Abhi Jun 19 '14 at 10:55
  • Even if you create a custom keyboard, you won't be able to select it automatically. To make a keyboard, there are tutorials on the Android developers website. – Basant Singh Jun 19 '14 at 11:04