开发者

Passwords in PreferenceActivity screen?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜