kavie
kavie

Reputation: 2244

Instagram sharing issue: Always I get the message “Unable to load image”

I'm working on share functionality

I 've a problem with Instagram Share

Here is my code :

How to I get rid of this problem?

Upvotes: 1

Views: 1401

Answers (1)

Hamed Nabizadeh
Hamed Nabizadeh

Reputation: 527

You can't share drawable directly

First create a file from drawable then share it

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/jpg");
File image = new File(getFilesDir(), "foo.jpg");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(image));
startActivity(Intent.createChooser(shareIntent, "Share image via"));

Upvotes: 1

Related Questions