Code example for ContextThemeWrapper

0
    private static Context wrapContextIfNeeded(Context context, AttributeSet attributeset)
    { 
        if(attributeset != null) {
        	int i = attributeset.getAttributeResourceValue(null, "theme", 0);
            if(i != 0)
                context = new ContextThemeWrapper(context, i); 
        } 
        return context;
    } 
 
    protected final void adjustFastScroll() 
    { 
        if(isFastScrollEnabled())
        { 
            setFastScrollEnabled(false);
            setFastScrollEnabled(true);
            int i = getWidth();
            int j = getHeight();
            onSizeChanged(i, j, i, j);
        } 
    }