title: Android: How to set password property in an edit text?
body: <p>I need to create a login form with 'username' 'password' fields and two buttons 'login' and 'cancel' in my android application. </p>
  
  <p>I am using an alert dialog with edittext inside that. </p>
  
  <p>This is the code I used to create password edittext..</p>
  
  <pre><code>     final EditText Password = new EditText(this);
       Password.setGravity(Gravity.CENTER);
       Password.setHint("Password");
       Password.setWidth(200);
  
       Password.setTransformationMethod(new PasswordTransformationMethod());
       login_alert.addView(Password);
  </code></pre>
  
  <p>My issue is that, plain text is shown instead of 'dots' when i open a softkeypad to edit the password. (It is shown as dots when not in softkeypad mode)</p>
  
  <p>Can anyone suggest a solution? </p>