@Nullable
    public static Drawable getDrawable(Context context, @AttrRes int attrId) {
        Drawable d = null;
        TypedArray a = context.obtainStyledAttributes(new int[]{attrId});
        try {
            d = a.getDrawable(0);
        } catch (UnsupportedOperationException e) {
            error("drawable", attrId, e);
        }
        a.recycle();
        return d;
    }
@Nullable
    public static Drawable getDrawable(Context context, @AttrRes int attrId) {
        Drawable d = null;
        TypedArray a = context.obtainStyledAttributes(new int[]{attrId});
        try {
            d = a.getDrawable(0);
        } catch (UnsupportedOperationException e) {
            error("drawable", attrId, e);
        }
        a.recycle();
        return d;
    }
@ Nullable public static Drawable getDrawable ( Context context , @ AttrRes int attrId ) { Drawable d = null ; TypedArray a = context . obtainStyledAttributes ( new int [ ] { attrId } ) ; try { d = a . getDrawable ( 0 ) ; } catch ( UnsupportedOperationException e ) { error ( "drawable" , attrId , e ) ; } a . recycle ( ) ; return d ; }
Get the Drawable specified by the attribute in the Context's theme.

@return null if the drawable does not exist
@since 4.0.0
Get the Drawable specified by the attribute in the Context s theme .