add CharacterStyle to Spannable - Android Graphics

Android examples for Graphics:Spannable

Description

add CharacterStyle to Spannable

Demo Code


//package com.java2s;

import android.text.Spannable;

import android.text.style.CharacterStyle;

public class Main {

    public static void addSpan(Spannable spOld, String str0, String str1,
            CharacterStyle style1) {/* www.j  a  v  a2 s. c o m*/
        spOld.setSpan(style1, str0.length(), str0.length() + str1.length(),
                Spannable.SPAN_INCLUSIVE_INCLUSIVE);
    }
}

Related Tutorials