Implement Numeric Keyboard

Asked

Viewed 3,204 times

0

I’m playing an application that needs to enter numbers to make the necessary calculations, but I would like when the user selects Text Field to see the alphabetic keyboard appear, the numeric keyboard appears. How to implement this function?

2 answers

4

Just configure the input type of your Edittext in the XML file.

<EditText android:inputType="number"/>

Or if you prefer, you can do this by Java itself:

myEditText.setInputType(InputType.TYPE_CLASS_NUMBER);

Links that may be useful to you:

  • Perfect. It worked here, I implemented via XML even to not give confusion to me later. Thanks.

  • You are welcome, @King. If desired, mark as solved. Hugs!

0

It’s very easy, just need to configure the input type of your Edittext in the XML file.

<EditText android:inputType="number"/>

Or in java:

edittext1.setInputType(InputType.TYPE_CLASS_NUMBER);

If you are an application user Sketchware sk

Browser other questions tagged

You are not signed in. Login or sign up in order to post.