'Android app - show "Change Keyboard" settings dialog

I am developing an android app in Java that needs to be set up as a keyboard.

I want to have a button that when the user presses my app shows the following dialog box:

enter image description here

This is a quick settings dialog box to allow the user to choose the input method (keyboard) it wants to use from now on. It is a default Android setting that is accessible to any user.

Normally this setting shows up when you press the following shortcut next to the android navigation bar when a keyboard is opened:

enter image description here

But in the context I am working on, this option is not visible to the user. So I want my app to be able to show this setting to the user when it presses a button.

I know an app that does this exact thing, so I know that it is possible. However, I don't know how to code a button that displays a system dialog box like this one.

Could you please help me?

Thanks in advance!



Solution 1:[1]

After some more research I found the answer using an InputMethodManager object and the showInputMethodPicker() method in Java:

InputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
inputMethodManager.showInputMethodPicker();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Felipe