user410932
user410932

Reputation: 3015

Passwords in PreferenceActivity screen?

I'm implementing a PreferenceActivity, which would 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)?

Upvotes: 1

Views: 2083

Answers (3)

kabuko
kabuko

Reputation: 36302

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

android:inputType="textPassword"

Upvotes: 4

ngesh
ngesh

Reputation: 13501

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

Upvotes: 0

Kaj
Kaj

Reputation: 10949

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

See android:password or setTransformationMethod(TransformationMethod)

Upvotes: 2

Related Questions