Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get color from resource android

In activity :
	ContextCompat.getColor(actvityname.this, R.color.your_color);
    
In fragment :
	ContextCompat.getColor(getActivity(), R.color.your_color);

Another method :
	getColor(R.color.snackBarAction)
 
PREVIOUS NEXT
Tagged: #color #resource #android
ADD COMMENT
Topic
Name
6+7 =