无法通过Android分享意图与链接共享文本 [英] Unable to share text with a link through Android Share Intent

查看:134
本文介绍了无法通过Android分享意图与链接共享文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我想与下面的链接共享文本是我的代码

now i want to share text with a link below is my code

String myText = "Hey!\nThis is a my Text!";

Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
String extraText = "www.mylink.com\n\n" + myText ;
share.putExtra(Intent.EXTRA_TEXT, extraText);
startActivity(Intent.createChooser(share, "Share with Friends"));

所以它可以用gmail,twitter等工作正常,但它不在Facebook上工作

so it work work fine with gmail, twitter etc. but it is not working on facebook

在Facebook上它只共享链接,但没有显示我的文本

我想这种类型的共享

www.mylink.com

here is my text

任何帮助将不胜感激,
感谢提前。

Any help would be appreciated, Thanks in Advance.

推荐答案

您在这里遇到的问题可能是Facebook不会在Intent中提供额外的信息。因为它适用于Gmail和Twitter。

The problem you have here is probably that Facebook doesn't look at the extra information provided in the Intent. Because it works for Gmail and Twitter.

查看 Android和Facebook分享意图

这篇关于无法通过Android分享意图与链接共享文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆