How do I specify EditText inputType as number and password?

前端 未结 3 1534
感情败类
感情败类 2020-12-10 10:16

I have the following:


I\'m getting a

3条回答
  •  青春惊慌失措
    2020-12-10 11:09

    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.

提交回复
热议问题