Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get color from color file in adroid studio

int backgroundColor = ContextCompat.getColor(context, R.color.my_view_color);
// Color backgroundColor = ... (Don't do this. The color is just an int.)

myView.setBackgroundColor(backgroundColor);
 
PREVIOUS NEXT
Tagged: #color #color #file #adroid #studio
ADD COMMENT
Topic
Name
9+3 =