android ACTION_发送图像和文本

android ACTION_发送图像和文本,android,facebook,image,post,text,Android,Facebook,Image,Post,Text,我想从我的应用程序发送到facebook和其他应用程序的图像和一些文字,以便用户可以共享它们。目前我把文本和图像的URI,但当我选择facebook只发送图像。在whatsApp中,也只发送图像。在Google+应用程序中,图像和文本都被传递。有人能告诉我正确的方向吗 代码示例(我现在没有原始代码,可能以后再发布) 如果我将ACTION\u SEND更改为ACTION\u SEND\u倍数,则它根本不起作用。如果我将类型更改为“text/plain”或html,则文本会发送到whatsapp、g

我想从我的应用程序发送到facebook和其他应用程序的图像和一些文字,以便用户可以共享它们。目前我把文本和图像的URI,但当我选择facebook只发送图像。在whatsApp中,也只发送图像。在Google+应用程序中,图像和文本都被传递。有人能告诉我正确的方向吗

代码示例(我现在没有原始代码,可能以后再发布)


如果我将ACTION\u SEND更改为ACTION\u SEND\u倍数,则它根本不起作用。如果我将类型更改为“text/plain”或html,则文本会发送到whatsapp、google+和Facebook messenger,但不会发送到普通的Facebook应用程序中(它会打开一个空共享对话框)。

您应该使用以下行

           Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.setType("image/*");
            sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My image");
           sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(filename_toshare)));// this is for image . here filename_toshare is your file path.
            sendIntent.putExtra(Intent.EXTRA_TEXT, "My Image ");// this is for text
            startActivity(Intent.createChooser(sendIntent, "Email:"));  

希望这对你有帮助

这段代码意味着,通过添加“额外主题”,我的“额外文本”也将被发送?因为我看不到你的代码和我的代码之间有任何其他的实际差异。实际上在facebook上,你不能通过action send或actionsend multiple从应用程序发送任何文本,因为这是facebook中已知的错误。但是你可以把短信发送到twitter、g+、gmail和其他网站。这取决于应用程序。。像whats应用程序一样,它也不允许我们从应用程序发送文本。我们需要在那边打字。有什么解决办法吗?也许直接使用facebook图形API?
           Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.setType("image/*");
            sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My image");
           sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(filename_toshare)));// this is for image . here filename_toshare is your file path.
            sendIntent.putExtra(Intent.EXTRA_TEXT, "My Image ");// this is for text
            startActivity(Intent.createChooser(sendIntent, "Email:"));