With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable().
getResources().getDrawable()
getDrawable()
What changed? <
If you are targeting SDK > 21 (lollipop or 5.0) use
context.getDrawable(R.drawable.your_drawable_name)
See docs