Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add colon to InputType.TYPE_CLASS_NUMBER keyboard

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?

like image 838
powder366 Avatar asked Nov 12 '22 22:11

powder366


1 Answers

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

Android doc

like image 137
Todd Sjolander Avatar answered Jan 04 '23 02:01

Todd Sjolander