微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用共享表发送带预览的链接

如何解决使用共享表发送带预览的链接

我正在尝试在我的应用程序中执行以下操作:

enter image description here

基本上,我的目标是让用户能够与他们的朋友分享我的应用(在这个例子中,我使用了谷歌链接)。

我尝试执行以下操作,但没有奏效:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,"I really liked the app! you should try it too =) \n\n" + getResources().getString( R.string.ActivityProfile_ShareMessage ));
sendIntent.setType("text/plain");

Intent shareIntent = Intent.createChooser(sendIntent,null);
startActivity(shareIntent);

哪里

<string name="ActivityProfile_ShareMessage">![CDATA[via <a href="http://google.com">Download the app from the Play Store</a>]]</string>

但它只给了我一个文本而不是链接,而且没有任何预览,如图所示。

有什么办法吗?

此外,我看到有适用于电子邮件或 WhatsApp 的解决方案。两者都没有解决办法吗?例如,text/html 不适用于消息等。

谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。