public static Spannable createSpannableFromTextWithTemplate(String text,CharSequence innerTemplate){
  SpannableString result=new SpannableString(text);
  if (innerTemplate instanceof Spanned) {
    int index=text.indexOf(innerTemplate.toString());
    if (index >= 0) {
      copySpans(result,(Spanned)innerTemplate,index);
    }
  }
  return result;
}

public static Spannable createSpannableFromTextWithTemplate ( String text , CharSequence innerTemplate ) { SpannableString result = new SpannableString ( text ) ; if ( innerTemplate instanceof Spanned ) { int index = text . indexOf ( innerTemplate . toString ( ) ) ; if ( index >= 0 ) { copySpans ( result , ( Spanned ) innerTemplate , index ) ; } } return result ; }
create spannable from text that includes some charsequence . if the charsequence has any spans they would be copied to result spannable
