Issue
I have to share text with link. 'Share Text' is followed as. "Please click this. snapchat://video?param1=text "
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, text);
context.startActivity(Intent.createChooser(intent, "Share"));
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_TEXT, Html.html(text));
context.startActivity(Intent.createChooser(intent, "Share"));
All code showed link as general text. It is not acted on SMS or gmail app, etc.
How can I solve this?
Solution
You need to use android.content.Intent
.
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(android.content.Intent.EXTRA_TEXT, text);
intent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Title goes here")
context.startActivity(Intent.createChooser(intent, "Share"));
Answered By - Taseer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.