public static Drawable getCompatDrawable(Context c, int drawableRes) {
        Drawable d = null;
        try {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                d = c.getResources().getDrawable(drawableRes);
            } else {
                d = c.getResources().getDrawable(drawableRes, c.getTheme());
            }
        } catch (Exception ex) {
        }
        return d;
    }
public static Drawable getCompatDrawable ( Context c , int drawableRes ) { Drawable d = null ; try { if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . LOLLIPOP ) { d = c . getResources ( ) . getDrawable ( drawableRes ) ; } else { d = c . getResources ( ) . getDrawable ( drawableRes , c . getTheme ( ) ) ; } } catch ( Exception ex ) { } return d ; }
helper method to get the drawable by its resource. specific to the correct android version

@param c
@param drawableRes
@return