Code example for ImageSpan

0
        } 
 
        int len = text.length();
        text.append("\uFFFC");
 
        text.setSpan(new ImageSpan(d, src), len, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    } 
 
    private static void startFont(SpannableStringBuilder text, Attributes attributes) {
        String color = attributes.getValue("", "color");
        String face = attributes.getValue("", "face");
        String style = attributes.getValue("", "style");
        String parsedColor = HtmlUtils.getStringFontColor(style);
 
        int len = text.length();
        text.setSpan(new Font(parsedColor != null ? parsedColor : color, face), len, len, Spanned.SPAN_MARK_MARK);
    } 
 
    private static void endFont(SpannableStringBuilder text) {
        int len = text.length();
        Object obj = getLast(text, Font.class);