Code example for SpannedString

0
 
        // First test with a SpannableStringBuilder, as opposed to SpannedString 
        checkPostProcess(HtmlUtils.postprocess(getContext(), builder));
 
        // Then pass a SpannedString, which is immutable, but the method should still work. 
        checkPostProcess(HtmlUtils.postprocess(getContext(), new SpannedString(builder)));
    } 
 
    /** 
     * Same as {@link #testPostProcess_with_newlines}, but text has no newlines. 
     * (The internal code path is slightly different.) 
     */ 
    public void testPostProcess_no_newlines() { 
        final SpannableStringBuilder builder = new SpannableStringBuilder("01234");
 
        setSpans(builder);
 
        // First test with a SpannableStringBuilder, as opposed to SpannedString 
        checkPostProcess(HtmlUtils.postprocess(getContext(), builder));
 
        // Then pass a SpannedString, which is immutable, but the method should still work.