bifko
bifko

Reputation: 41

Android,Problem:Trying to Send a Link By email

i am sending a simple email and in the body i put a Link .

My problem is the link is not recognize as Link but only as String

Here the code:

 intent.putExtra(Intent.EXTRA_EMAIL,new String[]{ "[email protected]"}); 
       Uri myUri = Uri.parse("http://www.stackoverFlow.com/");
       intent.putExtra(Intent.EXTRA_TEXT,  "Check out this great application:"+"\n"+ myUri);  
       intent.putExtra(Intent.EXTRA_SUBJECT, "Traveler's Pharmacy");
       intent.setType("text/plain");   
       startActivity(Intent.createChooser(intent, "Choose Email Client"));
       startActivity(intent);

Thanks for helping

Upvotes: 4

Views: 5093

Answers (1)

Peter Knego
Peter Knego

Reputation: 80340

Change this two lines:

intent.setType("text/html");  

and

intent.putExtra(Intent.EXTRA_TEXT,  
                Html.fromHtml("Check out this great application: <a href=\""+ myUri+
                "\">Link</a>"));  

Upvotes: 10

Related Questions