如果我只发送文本,共享意图选择器不会提供Facebook/Twitter作为选项。
只有Gmail,Skype和Evernote是选项。
这是我的代码
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("plain/text");
shareIntent.putExtra(Intent.EXTRA_TEXT, text)
startActivity(Intent.createChooser(shareIntent, "Share using"));
我尝试过setType()的不同组合,包括text/*,text/html和在putExtra中传递超文本标记语言文本,如下所示:
shareIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("<p>This is the text that will be shared.</p>"));
当我使用“文本/普通”时,脸书作为一个选项出现,但选择它时文本无法加载。但是Twitter、电子邮件和短信上的文本可以加载。
还有其他人遇到过这个问题吗?
当我分享图片时,没有问题,Facebook以及其他社交媒体应用程序都可以在列表中使用。
此外,它应该是"文本/纯"而不是"纯/文本"根据留档。
这取决于每个应用程序定义了什么样的意图过滤器。< br >例如,如果我添加了intent-filter < code > Android . intent . action . send
如果我从Gallery中选择单个图像,我的应用程序将显示在列表中。但是,如果我选择多个,我的应用程序将不会出现,因为我没有为android.intent.action.send_multiple
添加intent文件
因此,这取决于Facebook过滤的意图。您需要查看发行说明或帮助或开发人员页面。
facebook问题是对facebook权限的限制。使用facebook API