Change the input method of the Android-based Android device

I am developing one small application in Android, which consists of Text Editing and a button. The button will be visible only after the edit text is not empty. Since I have an LG Optimums device for Android, whenever I click “Edit Text”, since this is an LG device, the LG Key keyboard will appear, but I don’t want the Key Board I want the Android Key to use. I also know that I can go into Setting => Language and Key Board, and I can change this Key Board. But I do not want to use this, I want this to be done only through coding.

Thanx for any reference .....

+6
source share
4 answers

Unable to change software keyboard settings for user. The only thing you can do is advise the user to change it and help him do it. For example, this will show a dialog for changing the 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(); } } 
+15
source

As for what I saw from the Android employee here , it is simply impossible to change the IME programmatically - it depends entirely on the end user to select the preferred IME.

+2
source

As Paul said, you cannot change the IME; however you can disable the Android soft keyboard by hiding it

 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 

then create a view similar to the on-screen keyboard of Android. Check this.

+2
source

Change the keyboard from your application on the Click button:

  Button keyboard = (Button) findViewById(R.id.keyboardChange); keyboard.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); imeManager.showInputMethodPicker(); } }); 
0
source

Source: https://habr.com/ru/post/894036/


All Articles