title: How to set the text color of TextView in code?
body: <p>In XML, we can set a text color by the <code>textColor</code> attribute, like <code>android:textColor="#FF0000"</code>. But how do I change it by coding?</p>
  
  <p>I tried something like:</p>
  
  <pre><code>holder.text.setTextColor(R.color.Red);
  </code></pre>
  
  <p>Where <code>holder</code> is just a class and <code>text</code> is of type <code>TextView</code>. Red is an RGB value (#FF0000) set in strings.</p>
  
  <p>But it shows a different color rather than red. What kind of parameter can we pass in setTextColor()? In documentation, it says <code>int</code>, but is it a resource reference value or anything else?</p>