How to add a properly formatted link (with a hash tag) to an email using Android intent?

I create an email address and populate the message with a link containing a hash tag:

emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "http://en.wikipedia.org/wiki/Android_(operating_system)#Software_development");

As soon as I post it and reopen it on Android, the default email client only links to http://en.wikipedia.org/wiki/Android_(operating_system)

Is there any way to fix this problem?

+3
source share
2 answers

This is the default email problem in Android. Links work great with the gmail app!

+1
source

Try the following. I cannot verify my code due to a problem in my IDE.

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            emailIntent.setType("text/html");
            emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "subject");
            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("http://en.wikipedia.org/wiki/Android_(operating_system)#Software_development"));

Thanks Deepak

0
source

All Articles