0

I am trying to share an image and text. When I'm doing this:

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);

It works greate on all apps (that was choosen from the popup dialog like Gmail) except for facebook, facebook takes only the image and not the text. Is there a whay to pass an extra text with an image to the facebook app? Thanks!

roiberg
  • 13,629
  • 12
  • 60
  • 91
  • 1
    Is [this](http://stackoverflow.com/questions/5214764/how-to-share-photo-with-caption-via-android-share-intent-on-facebook) what you are looking for? – James May 15 '13 at 14:16
  • Yes, but the solution is not working for me... – roiberg May 15 '13 at 14:30

1 Answers1

3

There is a bug in FACEBOOK I have the same problem If you really want to do that anyhow you need to use facebook SDK for that and use Facebook ShareDialog.

Ajay
  • 552
  • 2
  • 4
  • 16