Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Java :: sort list java 8 
Java :: java string to number 
Java :: find maximum in array java 
Java :: java localtime 
Java :: docker java image 
Java :: jbutton open jframe java 
Java :: sorting in java 
Java :: find length of array java 
Java :: exception in thread "main" java.lang.indexoutofboundsexception: index 1 out of bounds for length 1 
Java :: list of numbers java 
Java :: Concept of Association in java 
Java :: java swing dialog box 
Java :: java run cmd 
Java :: random int in range java 
Java :: make edittext not editable android 
Java :: java hello word 
Java :: initialize hashmap with values 
Java :: java is list ordered 
Java :: I/flutter (10109): {filePath: null, errorMessage: java.io.FileNotFoundException: open failed: EACCES (Permission denied), isSuccess: false} 
Java :: java sql query with parameters 
Java :: java list select field 
Java :: java stop script 
Java :: java set textview style 
Java :: java remove map 
Java :: rock paper scissor in java 
Java :: how to use a combo box in java with if else 
Java :: tostring in java 
Java :: java iterator index 
Java :: java netbeans textfield only numbers 
Java :: print statement in java 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =