Reputation: 7789
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?
Upvotes: 29
Views: 50314
Reputation: 24847
Just set your input type to this android:inputType="textPassword|number"
Upvotes: 2
Reputation: 13421
you should use TYPE_CLASS_NUMBER.
EDIT:
As this answer
android:inputType="textPassword|number"
ignore textPassword and only accept number but not password.
So you should use android:inputType="textPassword|number"
with android:password="true"
.
that seems to be the only solution.
Upvotes: 18