title: Changing Color with LinearLayout and TextView in Java (Android)
body: <p>I'm a relatively new Android developer and I noticed what seems like an oddity to me that I'm hoping someone can explain. I have LinearLayout ll. </p>
  
  <p>This line of code fails for me when executed:</p>
  
  <pre><code>ll.setBackgroundColor(R.color.white);
  </code></pre>
  
  <p>However this line of code works:</p>
  
  <pre><code>ll.setBackgroundResource(R.color.white);
  </code></pre>
  
  <p>I assume its simply because I have white defined in my resources. However, I've also tried passing 0xFFFFFF in setBackgroundColor() and that doesn't work either.</p>
  
  <p>Similarly with my TextView text this line of code fails when executed:</p>
  
  <pre><code>text.setTextColor(R.color.white);
  </code></pre>
  
  <p>I can see my TextView so I know I initialized it correctly (like my LinearLayout which I can also see). So I guess my question boils down to: How do I properly use LinearLayout.setBackgroundColor() and TextView.setTextColor() ?</p>
  
  <p>Thanks a ton in advance. I've read through the docs and tried to find information online via googling and haven't come up with anything.</p>