-1

In my android app i want to share a Link to my website using intent but i dont want it to be visible to other user

example i want to share "smoe website link"

But to user it should look like "Click me to see it".

I tried this but wasnt successfull it just shows the simple text and was not clickable

<string name="app_link"><a href="My website link">Click me!</a></string>

 Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra("PostID", postID);
    intent.putExtra("UserID", userID);
    intent.putExtra(android.content.Intent.EXTRA_TEXT,activity.getString(R.string.app_link);
    activity.startActivity(Intent.createChooser(intent, "Share"));

Any help will be really appreciated.

Android
  • 1,085
  • 4
  • 13
  • 28
  • Possible duplicate of [How do I make links in a TextView clickable?](http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable). [This](http://stackoverflow.com/a/2746708/1306419) answer on the above question is probably what you are looking for. – Shobhit Puri Feb 24 '16 at 22:22
  • i know how to make a text view clickable in my app but what i want is when i share a text through whatsapp and anyother application then i want to hide the link and show simple text – Android Feb 25 '16 at 07:25

1 Answers1

1

What you want is not realistically possible right now.

EXTRA_TEXT must always be interpreted as plain text by the receiving app. You could try using EXTRA_HTML_TEXT which was added with API 16. But many apps don't support HTML and will simply use EXTRA_TEXT instead (or not show any text at all if you omit EXTRA_TEXT).

cketti
  • 1,277
  • 11
  • 15