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"
精彩评论