tausif tausif - 9 days ago 5
Android Question

Horizontal checked line android textview

This might be a simple question but I am not able to find a solution after hours of search.
How to achieve Strikethrough effect on the

TextView
given in the image below. The line length should be same as the text length.

enter image description here

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

Make sure your textview width is WRAP_CONTENT.