user246114 user246114 - 1 year ago 109
Android Question

Set inputType for an EditText?

How do we set the input type for an EditText programatically? I'm trying:


it doesn't seem to have any effect.

Answer Source

According to the TextView docs, the programmatic version of android:password is setTransformationMethod(), not setInputType(). So something like:


should do the trick.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download