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?
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.
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.
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.
Use android:inputType="textPostalAddress"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With