I need to create a login form with \'username\' \'password\' fields and two buttons \'login\' and \'cancel\' in my android application.
I am using an alert dialog w
My search for a similar solution for Visual Studio 2015/Xamarin lead me to this thread. While setting the EditText.InputType
to Android.Text.InputTypes.TextVariationVisiblePassword
properly hid the password during user entry, it did not 'hide' the password if it was visible before the EditText Layout was rendered (before the user submitted their password entry). In order to hide a visible password after the user submits their password and the EditText Layout is rendered, I used EditText.TransformationMethod = PasswordTransformationMethod.Instance
as suggested by LuxuryMode.
You need to use PasswordTransformationMethod.getInstance()
instead of new PasswordTransformationMethod()
.
This is deprecated
In xml of EditText iclude this attribute: android:password="true"
Edit
android:inputType="textPassword"