I have created a alert dialog with edit text. How to set the property of the edittext as password?
Here is the code...
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_TEXT| InputType.TYPE_TEXT_VARIATION_PASSWORD);
alert.setView(input); //edit text added to alert
alert.setTitle("Password Required"); //title setted
input.setTransformationMethod(PasswordTransformationMethod.getInstance());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With