add Span to Spannable - Android android.text

Android examples for android.text:SpannableString

Description

add Span to Spannable

Demo Code

import android.text.Spannable;
import android.text.style.CharacterStyle;

public class Main {

  public static void addSpan(Spannable spOld, String str0, String str1, CharacterStyle style1) {
    spOld.setSpan(style1, str0.length(), str0.length() + str1.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
  }//from   w w  w.  j  ava 2 s.  c  o m

}

Related Tutorials