how to remove underline for textview in android

textview, underline

Solution

You can try

 textview.setPaintFlags(textview.getPaintFlags() & (~ Paint.UNDERLINE_TEXT_FLAG));

or more broadly just set,

`textview.setPaintFlags(0)` but the first option is more exact

Problem

I have seen many questions regarding removing of underline for autolink of textview. But for me, I am unable to remove underline for normal textview. I set the underline by: ``` textview.setPaintFlags(nameOnTemplateTextview.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); ```

Original source