Code example for SpannableStringBuilder

Methods: getSpanslength

0
 
        checkSmileys((SpannableStringBuilder) messageStyler.getHistory());
    } 
 
    private void checkColor(final SpannableStringBuilder builder) {
        final ForegroundColorSpan[] spans = builder.getSpans(0, builder.length(), ForegroundColorSpan.class);
 
        assertNotNull(spans);
        assertEquals(1, spans.length);
        assertEquals(50, spans[0].getForegroundColor());
    } 
 
    private void checkLinks(final SpannableStringBuilder builder) {
        final URLSpan[] spans = builder.getSpans(0, builder.length(), URLSpan.class);
 
        assertNotNull(spans);
        assertEquals(1, spans.length);
        assertEquals("http://kouchat.googlecode.com/", spans[0].getURL());
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE