I want users to enter a zip code into my application. A common use case is the US zip code, which consists entirely of numbers, so I would like to first display the numeric keypad on soft input. However, not all postal codes are exclusively numbers, so I still need to allow users to enter other characters.
I tried to do this using android:inputType , but by setting the "number" flag, it automatically blocks any input except for numbers. Is there a way to just accept the general text, but get a soft keyboard to initially display the keyboard based on numbers?
android
Daniel Lew
source share