5

How can I add colon(:) to the soft keyboard with the input type InputType.TYPE_CLASS_NUMBER Currently I have the following code:

    NumberKeyListener keyListener = new NumberKeyListener() {
        public int getInputType() {
            return InputType.TYPE_CLASS_NUMBER;
        }

        @Override
        protected char[] getAcceptedChars() {
            return new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ':', '-', ',' };
        }
    };
    mytext.setKeyListener(keyListener);

But I also like the colon(:) on the number keyboard?

HitOdessit
  • 7,198
  • 4
  • 36
  • 59
powder366
  • 4,351
  • 7
  • 47
  • 79

1 Answers1

1

In order to change the characters on a soft keyboard, you need to create a custom IME.

Android doc

Todd Sjolander
  • 1,459
  • 1
  • 15
  • 28