title: Programmatically created EditText's Input Type Password not working
body: <p>I have created an <code>EditText</code> programmatically in <code>AlertDialog</code> but am not able to change its input type to password. Below is my code,</p>
  
  <pre><code>AlertDialog.Builder alert = new AlertDialog.Builder(this);
  final EditText edittext = new EditText(ChildMainScreen.this);
  edittext.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
  edittext.setSingleLine(true);
  alert.setMessage("Please enter password to continue");
  alert.setView(edittext);
  alert.show();
  </code></pre>
  
  <p>I have also tried,</p>
  
  <pre><code>edittext.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>edittext.setTransformationMethod(PasswordTransformationMethod.getInstance());
  </code></pre>
  
  <p>But no luck.</p>
  
  <p>Android version is 7 (Nougat)</p>