You cannot force input method editors (IMEs) to have any particular
keys. You can *request* general *classes* (e.g., numeric), and the IME
*may* elect to honor that request. However, there isn't even a way to
request a particular key, let alone any way to ensure that it will be
there.

Either use a class that is likely to have the desired key on it
already (e.g., TYPE_CLASS_TEXT), or have your own button for adding in
such characters in your own UI (e.g., a colon Button adjacent to the
EditText).

On Sat, Sep 8, 2012 at 9:01 AM, powder366 <[email protected]> wrote:
> 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', '.', ':', '-', ',' };
>         }
>     };
>
> But I also like the colon(:) on the number keyboard?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to