public static SpannableString spanText(CharSequence text,Object... spans){
  SpannableString spannableString=new SpannableString(text);
  for (  Object span : spans) {
    spannableString.setSpan(span,0,text.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
  }
  return spannableString;
}

public static SpannableString spanText ( CharSequence text , Object ... spans ) { SpannableString spannableString = new SpannableString ( text ) ; for ( Object span : spans ) { spannableString . setSpan ( span , 0 , text . length ( ) , Spanned . SPAN_EXCLUSIVE_EXCLUSIVE ) ; } return spannableString ; }
sets span objects to the text . this is more efficient than creating a new instance of spanny or spannablestringbuilder .
