Android : Android SpannableString EditText disable interaction

on Friday, March 20, 2015


i have a situation where I build a string of "Happy Friday - with friendA, friendB"


I'm using SpannableString:



SpannableString content = new SpannableString(original);
content.setSpan(new StyleSpan(Typeface.ITALIC), original.lastIndexOf(" - with "), content.length(), 0);
editText.setText(content);


I can achieve a italic style of " - with friendA, friendB".


What I'd like to achieve is to disable editing or touch on the SpannableString (" - with friendA, friendB"), but I can still edit the editText...is there any workarounds? Thanks.


0 comments:

Post a Comment