Question Detail

I am trying to change the tinting color of an EditText View programmatically during runtime. Basically, i want to change what you would usually apply ?attr/colorControl as like in the Normal background drawable.

Changing the background tint does not correctly apply by just setting a new ColorsStateList with one color:

editText.setBackgroundTintList( ColorStateList.valueOf( color ) );

For one the result is applied to all EditText although the tint list is applied and internally mutates the drawable. Also, the alpha as specified in the default background 1 is visible at the beginning.

Here is the outcome of setting the tint color on just the first EditText:

So my question would be: How can I properly apply the tint programmatically to an EditText?

Please Login!

Question and Answer site helps your online community to share knowledge. People with questions get the answers they need. The community is enriched by commenting, voting, notifications, points and rankings. QnA seizes the opportunity to help the large number of people without a moment's delay as we can. The concentrations are an impression of the sum We've helped some person.