Email issue (send hyperlink in email body) android

前端 未结 3 816
情深已故
情深已故 2020-12-06 02:59
mIntent = new Intent(Intent.ACTION_SEND);
mIntent.putExtra(Intent.EXTRA_SUBJECT, getString(\"\"));

mIntent.setType(\"text/html\");  
Uri myUri = Uri.parse(\"http://         


        
相关标签:
3条回答
  • 2020-12-06 03:22

    Try this one.. It is working for me..

    String link_val = "www.google.com"
    String body = "<a href=\"" + link_val + "\">" + link_val+ "</a>"
    
    intent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
    
    0 讨论(0)
  • 2020-12-06 03:36

    CapDroid's answer does not look like it solves the problem, as per scottytab's comment.

    Try;

    yourIntent.setType("text/html");
    yourIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
    

    If that doesn't work try adding;

    yourIntent.putExtra(android.content.Intent.EXTRA_HTML_TEXT, Html.fromHtml(body));
    

    References; fromHtml, EXTRA_HTML_TEXT

    0 讨论(0)
  • 2020-12-06 03:42

    If you make the EXTRA_TEXT a full html document by enclosing the source text in <html><body> and <\body><\html> it will work properly with GMail, that is, you can have a proper description for the link.

    Unfortunately, it won't work with all email apps. For example it does not work with the Samsung email app on my Galaxy S3. My conclusion is that you cannot safely do this, which is very annoying.

    0 讨论(0)
提交回复
热议问题