Skip to content
Advertisement

How to remove underline in hyperlink

I have a TextView on my ‘settings’ activity:

JavaScript

I have defined my URL on the string.

JavaScript

On my settings.kt page I have the following code onCreate:

JavaScript

From what I have found, I need to add a ‘spannable’ in relation to the above (settings.kt) but I’m not sure how to apply it, as everyone adds hyperlinks differently.

Advertisement

Answer

As you mentioned you have to add spanable first add this function(this is a kotlin extention function for textview):

JavaScript

}

then to use this function and remove underline type:

replace your textview with correct one(name of your textview)

JavaScript

more info about kotlin extention functions: this

more about removing hyperlinks: this

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement