.setBackground
was added in API Level 16
and .setBackgroundResource
was added in API Level 1
so you can use .setBackgroundResource
instead of .setBackground
Question
How to use
txtV1.setBackground(getResources().getDrawable(R.drawable.bcgrtxt));
in Older Devices ?
Solution 2
.setBackground
was added in API Level 16
and .setBackgroundResource
was added in API Level 1
so you can use .setBackgroundResource
instead of .setBackground
OTHER TIPS
View.setBackground
replaced View.setBackgroundDrawable
as of API level 16.