creating a strikethrough text?

Paint.STRIKE_THRU_TEXT_FLAG

TextView someTextView = (TextView) findViewById(R.id.some_text_view);
someTextView.setText(someString);
someTextView.setPaintFlags(someTextView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

For painting text, there are several bit flags for doing things like
bold, italics, and yes strikethrough. So to enable the strikethrough,
you need to flip the bit that corresponds to this flag. The easiest
way to do this is to use a bitwise-or on the current flags and a
constant that corresponds to a set of flags with only the
strikethrough flag enabled.

Edit from Comment by Ε Г И І И О :

For any one wanting to remove this flag, this is how:

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

Leave a Comment