Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android EditText inputType for StreetNumber field

I'm trying to choose correct inputType in my adress dialog streetNumber field. I want to show numeric keyboard first, but then let user also to input alphabetic characters for some very special cases. Closer to this is inputType datetime, but this doesn't allow to enter alphabetic characters. So how to set my streetNumber field correctly?

like image 324
Janci Avatar asked Jul 26 '11 09:07

Janci


People also ask

What is the EditText attribute Android inputType used for?

The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.

How do you edit text only in numbers?

Using phone inputType EditText has an attribute called android:inputType . Providing android:inputType with value phone can display numbered keyboard when the EditText gets focus. Create an Android Project and replace layout (activity_main. xml) and Kotlin file (MainActivity.

How do I get my keyboard to only show numbers on Android?

To get the number pad, and tap the special character key in the lower left corner of the keyboard. Then, tap the key just to the left of the spacebar with the numbers 1-4 in a little square.


1 Answers

Use android:inputType="textPostalAddress"

like image 80
Dharmendra Avatar answered Nov 12 '22 07:11

Dharmendra