1

I am working with an edit text to support the properties of bold,italic and underline.I got succeed after selecting the text and clicking on bold my text was bold.Now what my requirement is how to remove the bold again after selecting the text and clicking on bold button.

Regards, Bhavani.G


Thank you for the reply.Actually, What my need is if i select some text and clicking on Bold button(I have implemented this with spannable)in edit text/autocomplete text view my text is becoming bold.

Now, Again selecting the bolded text and by clicking on the bold button it should become normal text.

To achieve this i should know my text is in bold.How to do this??

Regards,

vani

0

2 Answers 2

0

Is this what your looking for?

((TextView) view).setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
0

RemoveSpan would to the trick i think, but you'll have to extract the part of your SpannableString in which you want to make the change to prevent removing all bold from your text! and then use TextUtils.concat(span1, span2, ...) from android.text to regroup ^^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.