title: Difference between getResources().getColor(R.color.Black) and directly R.color.Black
body: <p>i noticed a strange behavior of eclipse?</p>
  
  <p>I I have a static variable:</p>
  
  <pre><code>public static colorID = R.color.Black;
  </code></pre>
  
  <p>Sometimes it matches with R.color.Black:</p>
  
  <pre><code>if(colorID == R.color.Black)
       //sometimes it works
  </code></pre>
  
  <p>sometimes i Need to use </p>
  
  <pre><code>if(colorID == getResources().getColor(R.color.Black));
  </code></pre>
  
  <p>It's really annoying to find the fault by testing if your code is big...</p>
  
  <p>So i want to know why it sometimes work why not, and why the returning integer is sometimes different and sometimes not. They are both referencing to R.color.Black in my custom <code>color.xml</code> file in my <code>values</code> Folder. So why they are different sometimes?</p>