【问题标题】:How to share image and text to facebook app如何将图像和文本分享到 Facebook 应用程序
【发布时间】:2013-05-15 14:11:44
【问题描述】:

我正在尝试分享图片和文字。 当我这样做时:

Intent share = new Intent(Intent.ACTION_SEND);
        share.setType("image/*");
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        screenshot.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
        File f = new File(Environment.getExternalStorageDirectory()
                + File.separator + "temporary_file.jpg");
        try {
            f.createNewFile();
            FileOutputStream fo = new FileOutputStream(f);
            fo.write(bytes.toByteArray());
        } catch (IOException e) {
            e.printStackTrace();
        }
        share.putExtra(Intent.EXTRA_STREAM,
                Uri.parse("file:///sdcard/temporary_file.jpg"));
        share.putExtra(android.content.Intent.EXTRA_TEXT, textToShare);
        startActivityForResult(Intent.createChooser(share, "Share Image"),
                FROM_SHARE);

它适用于除 facebook 之外的所有应用程序(从 Gmail 等弹出对话框中选择),facebook 只接收图像而不接收文本。 有没有办法将带有图像的额外文本传递给 facebook 应用程序? 谢谢!

【问题讨论】:

  • this 你在找什么吗?
  • 是的,但该解决方案对我不起作用...

标签: android facebook image text share


【解决方案1】:

FACEBOOK 中有一个错误我也有同样的问题如果你真的想这样做,无论如何你需要使用 facebook SDK 并使用 Facebook ShareDialog。

【讨论】:

    猜你喜欢
    • 2014-03-21
    • 2012-05-18
    • 1970-01-01
    • 2021-01-18
    • 2023-04-08
    • 2014-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多