VaM999 VaM999 - 1 year ago 51
Android Question

How to send text which invoves hyperlink and plain text via intent?

I'd like to know how to send hyper link and plain text together concatenated (for example share button in the application details page in play store). I have this situation, I am designing a share button in my android application, which on clicking should take the user to any texting application ( this I have done this

). My problem is I either get a plain text on using
or just a hyperlink using
in which case I get only few applications to choose from (Gmail,Drive etc..). Below is my code:

Intent sharing_intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
sharing_intent.putExtra(Intent.EXTRA_SUBJECT,"Profile Changer");
String app_link ="market://details?id=" + getPackageName();
String hyperlink="<a href=\""+ app_link +"\">"+app_link+"</a>";
String share_app_text= Html.fromHtml(hyperlink) + "\nHey! Download this application.";
startActivity(Intent.createChooser(sharing_intent,"Recommend via"));

Could someone please tell me how to resolve this and it done? Thanks in advance

Answer Source
  Intent i = new Intent(Intent.ACTION_SEND);  
  i.putExtra(Intent.EXTRA_SUBJECT, "Your application name");
  String sAux = "\nLet me recommend you this application\n\n";
  sAux = sAux + " "+;
  i.putExtra(Intent.EXTRA_TEXT, sAux);  
  startActivity(Intent.createChooser(i, "choose one"));

}catch(Exception e){