Code example for TypedValue

0
        if (drawable == null) {
            return Drawable.createFromXmlInner(r, parser, attrs);
        } 
        drawable.inflate(r, parser, attrs);
        return drawable;
    } 
 
    private static Drawable getCachedDrawable(long key, Resources res) {
        WeakReference<Drawable.ConstantState> wr = sDrawableCache.get(key);
        if (wr != null) {
            Drawable.ConstantState entry = wr.get();
            if (entry != null) {
                return entry.newDrawable(res);
            } else { 
                sDrawableCache.delete(key);
            } 
        } 
        return null; 
    } 
 
    public static Drawable getDrawable(Resources res, int resid) {