2

I use fabric sdk for Android. Made all as in sample:

    TweetComposer.Builder builder = new TweetComposer.Builder(this)
             .text(((TextView) findViewById(R.id.tvMSG)).getText().toString());

            if (imgFileName!=null && !imgFileName.equals("")) {
                builder.image(Uri.parse(imgFileName));
            }

            builder.show();

where is imgFileName is a link to image in internet (http://b2b4trade.com/images..../2.jpeg for example) But when .show executed I see composer with my text but I don't see image. So my question is - how to compose tweet with image?

Murtaza Khursheed Hussain
  • 15,176
  • 7
  • 58
  • 83
w201
  • 2,018
  • 1
  • 11
  • 15

1 Answers1

1

Given that TweetComposer uses an Intent to share, the image URI you are setting as parameter must to be from a local image. So you would need to save the image to local disk before sharing it.

This question discuss a solution for that: android share image from url

Also, check the section "Sharing Remote Images" of this tutorial: https://github.com/codepath/android_guides/wiki/Sharing-Content-with-Intents

Remember also that if the user doesn't have the Twitter app installed on device the TweetComposer will fallback to a Web Intent and in this case the image will not be available to be shared, independently of building the solution above.

Community
  • 1
  • 1
Cipriani
  • 1,870
  • 14
  • 15