Code example for URLSpan

0
        { 
            Href h = (Href)obj;
             
            if (h.getHref() != null)
            { 
                _builder.setSpan(new URLSpan(h.getHref()), where, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            } 
        } 
    } 
     
    private void end(Class<?> kind, Object repl)
    { 
        int len = _builder.length();
        Object obj = getLast(_builder, kind);
        int where = _builder.getSpanStart(obj);
         
        _builder.removeSpan(obj);
         
        if (where != len)
            _builder.setSpan(repl, where, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    }