In XML, we can set a text color by the textColor attribute, like android:textColor=\"#FF0000\". But how do I change it by coding?
I tried s
In order to set color of a TextView, TextView.setTextColor(R.color.YOURCOLOR) is not enough!
It has to be used like this –
TextView myText = (TextView) findViewById(R.id.YoutTextViewID);
myText.setTextColor(getResources().getColor(R.color.YOURCOLOR);
OR
myText.setTextColor(Color.parseColor("#54D66A"));