1

Is there any known combinations of inputTypes on an inputText that would give a Num-pad keyboard with special characters such as $, *, # and &. I am trying to allow the user to input a number and that field could take the mentioned characters as well. I have tried many but none seem to be giving the required output.

Would I have to create my own custom keyboard for this? Since my request is very specific to certain special characters please do not mark this as a duplicate question. Thanks in advance.

syb0rg
  • 8,057
  • 9
  • 41
  • 81
lokoko
  • 5,785
  • 5
  • 35
  • 68

1 Answers1

2

You can use KeyboardView to for customizing as your need.

KeyboardView customKeyboard = new KeyboardView(context);
customKeyboard.setKeyboard(new Keyboard(this, R.xml.customLayout));

customKeyboard.setOnKeyboardActionListener(new OnKeyboardActionListener() {
    //do your work here
}

Where R.xml.customLayout refers to /res/xml/customLayout.xml. A very good tutorial for customizing a keyboard is..

Which will help you much better.

ridoy
  • 6,274
  • 2
  • 29
  • 60
  • Is it possible to show the number keyBoard by default the same that comes up when i click on the number option on the existing keyBoard – lokoko Feb 04 '13 at 07:47
  • try with editText.setRawInputType(Configuration.KEYBOARD_QWERTY). More information from http://stackoverflow.com/questions/3216169/numeric-soft-keyboard-on-android/3772860#3772860 – ridoy Feb 05 '13 at 20:15