Removing Strikethrough from TextView Removing Strikethrough from TextView android android

Removing Strikethrough from TextView


I ended up finding this online:

tv.setPaintFlags(tv.getPaintFlags() & (~ Paint.STRIKE_THRU_TEXT_FLAG));

This successfully removes the strikethrough and therefore I called this in my OnListItemClick method after carrying out a check in the database I made to see if the item had already been striked through (purchased in my case).


Another way is to simply set value of setPaintFlags to Zero.

tv.setPaintFlags(0) 

NOTE:

This will remove strike through your text and other Typeface design, You are free to use in case it doesn't applied to your view.


You can set an OnClickListener on the TextView, reset the paint flags, and call its invalidate() so it redraws itself.