Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pop-up the "?123" Android keyboard

I have an EditText which needs to process either numerical and/or alphabetical input depending on state. The user may enter either type of input in some circumstances. I've only been able to pop-up the "Phone" keyboard using setInputType (InputType.TYPE_CLASS_NUMBER); which works, but doesn't allow the user a way to get back to the QWERTY keyboard. Since most of the input is indeed numerical, I would like to present the user with the ?123 keyboard most of the time. They would only need to go back to the QWERTY keyboard a few times.

How can I pop-up the onscreen QWERTY keyboard for alphabetical input, and then pop-up the "?123" keyboard if it's numerical? I just want to save a step for the user so they don't have to hit the ?123 button on the QWERTY keyboard every time.

Update: This is the keyboard I would like visible. The reason is I would like the user to easily switch between Alphabetical input and Numerical input. There is no way to switch to the QWERTY keyboard from the "number pad". In my app, numerical input is required for 90% of the input so I would like to pop it up as a convenience. In other words, rather than having to switch to the numerical keyboard 90% of the time, they only need to switch to QWERTY 10% of the time enter image description here

The call to input.setRawInputType(Configuration.KEYBOARD_QWERTY); works differently on Honeycomb and later versions of Gingerbread (brings up the number pad). On Gingerbread 2.2.3 it works the way I want. Honeycomb and 2.3.7 keyboard screengrabs are below for reference. I don't know why they are so different.

Honeycomb 3.2 keyboard for Configuration.KEYBOARD_QWERTYGingerbread 2.3.7 keyboard for Configuration.KEYBOARD_QWERTY

like image 537
wufoo Avatar asked May 07 '12 21:05

wufoo


People also ask

How do you open the number keyboard on Android?

Numpad with Decimalinputmode='decimal' , which will instruct the browser to open the Numpad keyboard in android and ios.

How do I bring my keyboard up?

To be able to open it anywhere, you go into the settings for the keyboard and check the box for 'permanent notification'. It will then keep an entry in the notifications which you can tap to bring up the keyboard at any point.

How do I get symbols on my Android keyboard?

Remember that to type some symbols on your android keyboard, you have to switch to the other page containing the symbols, however, most of the commonly used symbols can be accessed by simply long-pressing the period (.) key. This gives you access to a bunch of useful symbols, such as &, %, +, #, !, and @.


1 Answers

You can use several ways to use number keyboard. Some are listed below,

Method 1: add this attribute to your text field(EditText)

android:inputType="number"

Method 2:

use it programmatically

edittext.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);
like image 114
Dev.Barai Avatar answered Oct 04 '22 02:10

Dev.Barai