title: Programmatically changing underline color of EditText
body: <p>I have an ordinary <code>EditText</code> field that I would like to programmatically change the underline color for.</p>
  
  <pre><code>&lt;EditText
      android:id="@+id/edit_password"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:inputType="textPassword"/&gt;
  </code></pre>
  
  <p>Other answers suggest changing the background color filter like so:</p>
  
  <pre class="lang-java prettyprint-override"><code>editText.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
  </code></pre>
  
  <p>However, I don't see any change when I run the app. Changing the background itself:</p>
  
  <pre class="lang-java prettyprint-override"><code>editText.setBackground(color)
  </code></pre>
  
  <p>changes the entire <code>EditText</code> to <code>color</code> - not what I want!</p>
  
  <p>How do I programmatically change the underline color for an <code>EditText</code>, <code>AppCompatEditText</code> or <code>TextInputEditText</code>? I am using version 25.0.1 of the Support Library.</p>