开发者

Passwords in PreferenceActivity screen?

开发者 https://www.devze.com 2023-03-23 23:52 出处:网络
I\'m implementing a PreferenceActivity, which w开发者_JAVA技巧ould ask the user for username and password.

I'm implementing a PreferenceActivity, which w开发者_JAVA技巧ould ask the user for username and password. I'll use EditTextPreference for the username, but what element do I need to have a "password input", which will hide the inputted data (i.e. change to dots)?


As android:password is deprecated. You should instead use inputType:

android:inputType="textPassword"


That should also be an EditText, but you configure it to "password"-mode.

See android:password or setTransformationMethod(TransformationMethod)


Use a TextView and in XML file make its property android:password = "true"

0

精彩评论

暂无评论...
验证码 换一张
取 消