4

I followed these two exemples of developer.android (Creating an Input Method, Soft Keyboard sample). Think everything is correct, but the custom keyboard dont shows up.

Sorry but i dont understand the code, how i call this new keyboard?

thanks for all.

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
user1279395
  • 108
  • 1
  • 7

2 Answers2

16

You can open the "Change input method" menu programatically like this:

InputMethodManager mgr = 
    (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (mgr != null) {
    mgr.showInputMethodPicker();
}

You may also want to open "Language & Input settings" so your users can enable your input method. You can do that like this:

startActivityForResult(
    new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS), 0);
Rubicon
  • 379
  • 2
  • 9
0

You need to select the new keyboard to be your default. You have to turn it on in the device settings first, and then you need to long press inside of an EditText to be able to get the InputOptions menu. This will allow you to select your keyboard

Mimminito
  • 2,803
  • 3
  • 21
  • 27
  • thanks, i see it now. But how i do this dynamically. For the user of the application do not have to do this? – user1279395 Mar 19 '12 at 20:59
  • You cannot do this programatically. You have to make the user select these. You can open these menus via code, but you will need to research those methods – Mimminito Mar 19 '12 at 21:04
  • any idea of how we do this? and how block my app for start only with the custom keyboard? – user1279395 Mar 20 '12 at 16:32
  • You need to simulate the long press inside of an EditText. Sorry you will need to research this yourself. – Mimminito Mar 20 '12 at 17:22