Answers for "getting a color from the resource file android studio"

1

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)
Posted by: Guest on November-03-2021

Code answers related to "getting a color from the resource file android studio"

Browse Popular Code Answers by Language