Code example for Annotation

0
 
        if (len == 0) {
            return s;
        } 
 
        s.setSpan(new Annotation("number", c.getNumber()), 0, len,
                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
 
        return s;
    } 
 
    public void populate(Recipients list) {
        SpannableStringBuilder sb = new SpannableStringBuilder();
 
        for (Recipient c : list.getRecipientsList()) {
            if (sb.length() != 0) {
                sb.append(", ");
            } 
 
            sb.append(contactToToken(c));
        }