title: android: How to use custom colors?
body: <p>Im trying to set the backgroundcolor of my <code>FrameLayout</code> using my own colors.</p>
  
  <p>I created a <code>.xml</code> file which contains my own colors.
  Here it is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;resources&gt;
      &lt;color name="red"&gt;#FF0000&lt;/color&gt;
      &lt;color name="orange"&gt;#FF7D00&lt;/color&gt;
      &lt;color name="yellow"&gt;#FFFF00&lt;/color&gt;
      &lt;color name="green"&gt;#00FF00&lt;/color&gt;
      &lt;color name="blue"&gt;#00B4FF&lt;/color&gt;
      &lt;color name="black"&gt;#000000&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>And here is the code where Im trying to set the backgroundcolor, but when I run the app, the <code>FrameLayout</code> is always grey, why?:</p>
  
  <pre><code>FrameLayout MyFrameLayout = new FrameLayout(this);
  LayoutParams MyFrameLayoutParam = new LayoutParams(LayoutParams.FILL_PARENT, 200);
  MyFrameLayout.setLayoutParams(MyFrameLayoutParam);
  
  MyFrameLayout.setBackgroundColor(R.color.red);
  
  Parent.addView(MyFrameLayout);
  </code></pre>