Reputation: 658
I'd like to ask a simple question, what is the equivalent android code for android:password="false" on the xml layout file. (I googled it but can't find the result:) )
Thank you
Upvotes: 0
Views: 890
Reputation: 75982
The equivalent to android:password="false"
is TextView.setTransformation(null)
. Using it with PasswordTransformationMethod
is equivalent of android:password="true"
Upvotes: 3
Reputation: 599
Documentation for that android:password attribute says to use
setTransformationMethod(TransformationMethod method)
on your TextView. Probably easier to use this:
setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD)
Upvotes: 0
Reputation: 10586
What do you mean by equivalent android code? If your Editview
field is password field, you set android:password="true"
, if it is not , you don't set anything
Upvotes: 0