问题描述
我正在尝试在我的应用程序中执行以下操作:
基本上,我的目标是让用户能够与他们的朋友分享我的应用(在这个例子中,我使用了谷歌链接)。
我尝试执行以下操作,但没有奏效:
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 (将#修改为@)