0

I am trying to add a hyperlink with my email intent using an anchor tag as shown in the image below. I am getting the URL and the description from a REST API. But when I send the email, the link itself is not getting hyperlinked but simply being displayed as plain text.

    

    val emailIntent = Intent(Intent.ACTION_SEND)
        emailIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
        emailIntent.putExtra(Intent.EXTRA_SUBJECT,"Subject of the mail")
        emailIntent.type = "text/html"
        emailIntent.putExtra(Intent.EXTRA_TEXT,
            HtmlCompat.fromHtml(emailDescription, HtmlCompat.FROM_HTML_MODE_LEGACY)
        )
        ...
       startActivity(emailIntent)
    
       val emailDescription = """
       <p> Dear ${response.userName},<br><br>  
        Tariffs for your plan has been increased by $10. 
        To know more visit our website <a href="${respone.websiteUrl}">${response.websiteDesc}</a><br</p> 
        
       """.trimIndent()

  

I wanted the output as shown in this image. But it is reflecting as plain text when the user recieves the mail. Thanks in advance.

dev
  • 1
  • Hey @dev, please refer this link [https://stackoverflow.com/questions/10696986/how-to-set-the-part-of-the-text-view-is-clickable] – piyushpk Nov 09 '20 at 11:18
  • Hi @piyushpk, I don't think so that the above link will help to resolve the problem. – dev Nov 09 '20 at 13:29

0 Answers0