@TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private static Drawable getDrawable(Context context, @DrawableRes int drawableResId) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return context.getDrawable(drawableResId);
        } else {
            return context.getResources().getDrawable(drawableResId);
        }
    }
@ TargetApi ( Build . VERSION_CODES . LOLLIPOP ) private static Drawable getDrawable ( Context context , @ DrawableRes int drawableResId ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { return context . getDrawable ( drawableResId ) ; } else { return context . getResources ( ) . getDrawable ( drawableResId ) ; } }
Convenience to use the new getDrawable(...) on Lollipop and the deprecated one on preLollipop.