android - ViewCompat setBackgroundTintList not working in API 21 : <p>I have a <em>AppCompatEditText</em> with the property <em>backgroundTint</em> setted to an specific color.
 I've created a method to change the background tint programmatically and its working in all Android versions since API 17 (4.2 Jelly Bean) to API 25 (7.1.1 Nougat), <strong>except API 21 (5.0 Lollipop)</strong>.</p>

<p>I don't know what I'm doing wrong. Here's my code:</p>

<pre><code>    public void changeViewBackgroundColor(Context context, View view, int color) {
      int theColor = ContextCompat.getColor(context, color);

      if (view instanceof TintableBackgroundView) {
        ColorStateList colorStateList = ColorStateList.valueOf(theColor);
        ViewCompat.setBackgroundTintList(view, colorStateList);
      } else {
        view.setBackgroundColor(theColor);
      }

      view.invalidate();
  }
</code></pre>
