Answers for "resources.getColor deprecated"

4

getcolor deprecated

ContextCompat.getColor(context, R.color.color_name)
Posted by: Guest on April-17-2020
0

getResources().getColor() is deprecated

yourView.setBackgroundColor(ContextCompat.getColor(applicationContext,
                            R.color.colorAccent))
Posted by: Guest on September-17-2021

Code answers related to "resources.getColor deprecated"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language