I see back in 2012 a Lint check was added (
*http://tools.android.com/recent/newlintrules-1)*

   - Find calls to setColor methods which pass the resource id for the 
   color (R.color.blue) instead of a resolved color 
   (getResources().getColor(R.color.blue)).
   
Can anybody remember why? There are several setColor methods that gladly 
take in a resource ID? Paint.setColor() comes to mind:
https://developer.android.com/reference/android/graphics/Paint.html#setColor(int)

Also if you wrote your own setColor method and properly annotated it to 
take in a color resource you are SOL:

private void setColorId(@ColorRes int color) {
        someTextView.setTextColor(getResources().getColor(color));
}

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to