Hi,
How do we set the input type for an EditText programatically? I'm trying:
mEdit.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
it doesn't seem to have any effect.
Thanks
Hi,
How do we set the input type for an EditText programatically? I'm trying:
mEdit.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
it doesn't seem to have any effect.
Thanks
Try adding this to the EditText/TextView tag in your layout
android:password="true"
Edit: I just re-read your post, perhaps you need to do this after construction. I don't see why your snippet wouldn't work.
According to the TextView docs, the programmatic version of android:password is setTransformationMethod(), not setInputType(). So something like:
mEdit.setTransformationMethod(PasswordTransformationMethod.getInstance());
should do the trick.