Android:与内置应用程序共享时无法获取正确的文本
我使用了以下代码Android:与内置应用程序共享时无法获取正确的文本,android,android-intent,share,Android,Android Intent,Share,我使用了以下代码 Intent share = new Intent(android.content.Intent.ACTION_SEND); share.setType("text/plain"); share.putExtra(Intent.EXTRA_SUBJECT, subject); share.putExtra( Intent.EXTRA_TEXT, "i have just visited http://ww
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_SUBJECT, subject);
share.putExtra(
Intent.EXTRA_TEXT,
"i have just visited http://www.google.com");
startActivity(Intent.createChooser(share,
"Share Sydneyho! with your friends via"));
当我选择gmail
时,它显示的是用Intent.EXTRA_TEXT编写的内容,但当我选择facebook
时,它的信息完全不同,我不知道它来自哪里
请帮忙 我使用以下代码片段与Action_共享消息并发送到其他应用程序
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra("android.intent.extra.SUBJECT", "");
sharingIntent.putExtra("android.intent.extra.TEXT", "ABC");
startActivity(Intent.createChooser(sharingIntent, "Share using"));
它在我的设备(安卓2.2)中运行良好。
从概念上讲,我不知道你的代码和上面的代码有什么不同。
但是上面的代码对我来说很好。在stackoverflow得到了一些类似的帖子,得出了我们不能传递文本的结论
在
要使其在facebook共享页面上可见,我们必须将链接传递到某个网站。您所说的“未获取正确文本”是什么意思?通过适当的文字,我的意思是说它在不同的应用程序中显示不同的信息。意思是当我选择gmail时,它显示的是写意。额外的文字,但当我选择facebook时,它显示的是完全不同的信息。这里有许多类似的问题等待着相同的答案。谢谢你的回答,不是我想要的,而是至少有人给出了一个很好的答案。这里有一个类似的帖子供你参考。看起来你只能向facebook发送一个纯URL,但不能将文本和URL混合发送。-------------------------------------这个问题很久以前就被列入了facebook的官方bug列表。但它仍然没有解决。
share.putExtra(Intent.EXTRA_TEXT,"bla bla bla");