Code example for UnderlineSpan

0
                    break; 
                case STRIKE:
                    text.setSpan(new StrikethroughSpan(), where, len, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                    break; 
                case UNDERLINE:
                    text.setSpan(new UnderlineSpan(), where, len, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                    break; 
                case COLOR:
                    ColorSpan colorSpan = (ColorSpan) span;
                    text.setSpan(new ForegroundColorSpan(colorSpan.mColor), where, len, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                    break; 
            } 
        } 
    } 
 
    private static class Code { 
    } 
 
    private static enum SpanType { 
        QUOTE, SPOILER, STRIKE, UNDERLINE, COLOR
    };