Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Input method of android device programatically android

I am developing one small application in android which consist of an Edit Text & Button. Button will be visible only after edit text is not blank.Since I am having LG Optimums Android device, Whenever i click on Edit Text since it it LG device, LG Key Board will appear but i don't want that Key Board i want Android Key Board to use. I Also know that i can go into Setting=>Language & Key Board & i can change that Key Board. But i don't want to use that i want it should be done only through coding.

Thanx for any Help.....

like image 435
Sumant Avatar asked Aug 01 '11 15:08

Sumant


People also ask

How do you change the input method?

Input Method Action Button is located in the bottom right corner of the soft keyboard.

What is textUri?

textUri. Text that will be used as a URI. textEmailAddress. Text that will be used as an e-mail address.


2 Answers

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();
        }
    }
like image 169
Cristian Avatar answered Sep 28 '22 20:09

Cristian


As far as I've seen, and from an Android employee here, it is simply not possible to change the IME programatically - it is completely dependent on the end-user to choose their preferred IME.

like image 26
Unpossible Avatar answered Sep 28 '22 19:09

Unpossible