user246114 user246114 - 10 months ago 56
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.