0

I have a shareButton in optionsMenu from where I would like to send a message via wasap, gmail... describing my app and containing a hyperlink to Google Play.

The problem is that the hyperlink doesn't appear, this is what I have done:

 mShareActionProvider =  (ShareActionProvider) MenuItemCompat.getActionProvider(item);
    Intent sharingIntent = new Intent(Intent.ACTION_SEND);
    sharingIntent.setType("text/html");
    String shareBody = getString(R.string.sharing_intent_text)+"https://www.google.com/";
    sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.sharing_intent_subject));
    sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
    mShareActionProvider.setShareIntent(sharingIntent);

And here are the strings that I am using

<string name="sharing_intent_text">Game descrition <a href=https://https://play.google.com/store/apps/details?id=packageName>App Name</a> more description</string>
<string name="sharing_intent_subject">Subject</string>

Even if I use sharingIntent.setType("text/html") the name of the game isn't clickable.

Spirrow
  • 1,120
  • 6
  • 18

1 Answers1

0

I have solved the problem, I need to add this Html.fromHtml(shareBody) when I put the extra text in order to pass the string to Html format

sharingIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(shareBody));
Spirrow
  • 1,120
  • 6
  • 18