How to toggle between two keyboards (Google keyboard and Custom IME SoftKeyboard) by clicking on a button?

219 Views Asked by At

I have created a EditText,Custom IME SoftKeyboard and a button. I want that when my app opens and I click on EditText, it opens with my Custom IME Softkeyboard and when I click on the button, it switches to Default Keyboard. When I again click on the button, it switches back again to IME SoftKeyboard. So, Basically I am looking for a functionality of OnClick on a button that switches between Default Keyboard and Custom IME Softkeyboard.

I explored InputMethodManager but I only got the way to show the default keyboard.

mKeyboardSwitcher.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                InputMethodManager imm= (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
            }
        });

This is my code. Its just shows up the default keyboard.

I want the button to switch between Default keyboard and Custom Keyboard.

0

There are 0 best solutions below