I have the following:
<EditText android:inputType="number" android:password="true" .... </EditText>
I'm getting a warning that "android:password" is deprecated and that I should use inputType instead. Is there a way to specify inputType as number and password?
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.
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. You'll get a cool little number pad along with common mathematical operators.
You can use android:inputType="number" in the XML file. You can specify other values such as numberDecimal as well. Also, you might additionally want to use android:singleLine="true" for a single line Edittext .
Set android:inputType="numberPassword"
See this Link
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