Answers for "android set color resource"

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 "android set color resource"

Browse Popular Code Answers by Language