title: Retrieve a color from values/colors.xml using a variable in name (R.color.name + variable)
body: <p>I have a list of colors in my colors.xml that all have names in the format tColor1, tColor2, tColor3, etc. and I want to retrieve them in a for-to-do loop using the looping integer as part of the name. So I have</p>
  
  <pre><code>for (int i = 0; i &lt; numTrails; i++) {
      newColors[i] = R.color.tColor + i;
  }
  </code></pre>
  
  <p>Now I understand that I can't use the R class like that, but what other method can I use to get the colors?</p>