Question

I am trying to dynamically change the font and background color of my app but when I try to set it just turns gray no matter what color I choose. I have verified the color is correct. any ideas.

mTitleText is a EditText

mTitleText = (EditText) findViewById(R.id.note_edit_title);
mTitleText.setTextColor(R.color.defaulttextred);
Was it helpful?

Solution

Just use

mTitleText.setTextColor(getResources().getColorStateList(R.color.defaulttextred));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top