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(ContactList list) {
        SpannableStringBuilder sb = new SpannableStringBuilder();
 
        for (Contact c : list) {
            if (sb.length() != 0) {
                sb.append(", ");
            } 
 
            sb.append(contactToToken(c));
        }